Hi,
At the moment the same test is being ran twice - same output so pointless!
I believe this may not be what was intended.
The change below runs the virtual register test the second time on the Predecessor SUnit.
Robert
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
index f5fe168…6e888da
— a/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
@@ -2850,7 +2850,7 @@ void RegReductionPQBase::PrescheduleNodesWithMultipleUses() {
continue;
// Avoid prescheduling to copies from virtual registers, which don’t behave
// like other nodes from the perspective of scheduling heuristics.
- if (SDNode *N = SU->getNode())
- if (SDNode *N = PredSU->getNode())
if (N->getOpcode() == ISD::CopyFromReg &&
TargetRegisterInfo::isVirtualRegister
(cast(N->getOperand(1))->getReg()))