[llvm] r177529 - Revert "pre-RA-sched: fix TargetOpcode usage"

Christian Konig christian.koenig at amd.com
Wed Mar 20 08:43:01 PDT 2013


Author: ckoenig
Date: Wed Mar 20 10:43:00 2013
New Revision: 177529

URL: http://llvm.org/viewvc/llvm-project?rev=177529&view=rev
Log:
Revert "pre-RA-sched: fix TargetOpcode usage"

This reverts commit 06091513c283c863296f01cc7c2e86b56bb50d02.

The code is obviously wrong, but the trivial fix causes
inefficient code generation on X86. Somebody with more
knowledge of the code needs to take a look here.

Signed-off-by: Christian König <christian.koenig at amd.com>

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=177529&r1=177528&r2=177529&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Wed Mar 20 10:43:00 2013
@@ -1894,15 +1894,12 @@ unsigned RegReductionPQBase::getNodePrio
     // CopyToReg should be close to its uses to facilitate coalescing and
     // avoid spilling.
     return 0;
-  if (SU->getNode() && SU->getNode()->isMachineOpcode()) {
-    Opc = SU->getNode()->getMachineOpcode();
-    if (Opc == TargetOpcode::EXTRACT_SUBREG ||
-        Opc == TargetOpcode::SUBREG_TO_REG ||
-        Opc == TargetOpcode::INSERT_SUBREG)
-      // EXTRACT_SUBREG, INSERT_SUBREG, and SUBREG_TO_REG nodes should be
-      // close to their uses to facilitate coalescing.
-      return 0;
-  }
+  if (Opc == TargetOpcode::EXTRACT_SUBREG ||
+      Opc == TargetOpcode::SUBREG_TO_REG ||
+      Opc == TargetOpcode::INSERT_SUBREG)
+    // EXTRACT_SUBREG, INSERT_SUBREG, and SUBREG_TO_REG nodes should be
+    // close to their uses to facilitate coalescing.
+    return 0;
   if (SU->NumSuccs == 0 && SU->NumPreds != 0)
     // If SU does not have a register use, i.e. it doesn't produce a value
     // that would be consumed (e.g. store), then it terminates a chain of
@@ -2588,15 +2585,12 @@ static bool canEnableCoalescing(SUnit *S
     // avoid spilling.
     return true;
 
-  if (SU->getNode() && SU->getNode()->isMachineOpcode()) {
-    Opc = SU->getNode()->getMachineOpcode();
-    if (Opc == TargetOpcode::EXTRACT_SUBREG ||
-        Opc == TargetOpcode::SUBREG_TO_REG ||
-        Opc == TargetOpcode::INSERT_SUBREG)
-      // EXTRACT_SUBREG, INSERT_SUBREG, and SUBREG_TO_REG nodes should be
-      // close to their uses to facilitate coalescing.
-      return true;
-  }
+  if (Opc == TargetOpcode::EXTRACT_SUBREG ||
+      Opc == TargetOpcode::SUBREG_TO_REG ||
+      Opc == TargetOpcode::INSERT_SUBREG)
+    // EXTRACT_SUBREG, INSERT_SUBREG, and SUBREG_TO_REG nodes should be
+    // close to their uses to facilitate coalescing.
+    return true;
 
   if (SU->NumPreds == 0 && SU->NumSuccs != 0)
     // If SU does not have a register def, schedule it close to its uses





More information about the llvm-commits mailing list