Revert 127368 and 127371 for now.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 9 Mar 2011 23:53:17 +0000 (23:53 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 9 Mar 2011 23:53:17 +0000 (23:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127376 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetRegisterInfo.h
lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
lib/Target/X86/X86RegisterInfo.cpp

index d06cdc4e8e5efe7c2088fc7ded5d77eb9251db58..1c5d7c711876e569c02985bb87dcb5cbbc1f14e6 100644 (file)
@@ -588,13 +588,11 @@ public:
   }
 
   /// getCrossCopyRegClass - Returns a legal register class to copy a register
-  /// in the specified class to or from. If it is possible to copy the register
-  /// directly without using a cross register class copy, return the specified
-  /// RC. Returns NULL if it is not possible to copy between a two registers of
-  /// the specified class.
+  /// in the specified class to or from. Returns NULL if it is possible to copy
+  /// between a two registers of the specified class.
   virtual const TargetRegisterClass *
   getCrossCopyRegClass(const TargetRegisterClass *RC) const {
-    return RC;
+    return NULL;
   }
 
   /// getRegPressureLimit - Return the register pressure "high water mark" for
index 7b560d173ed3bdb8a1e31ccc1c991b894d95b279..e3da2084529a1a3f416aa437b4b343a34110637f 100644 (file)
@@ -570,20 +570,13 @@ void ScheduleDAGFast::ListScheduleBottomUp() {
           TRI->getMinimalPhysRegClass(Reg, VT);
         const TargetRegisterClass *DestRC = TRI->getCrossCopyRegClass(RC);
 
-        // If cross copy register class is the same as RC, then it must be
-        // possible copy the value directly. Do not try duplicate the def.
-        // If cross copy register class is not the same as RC, then it's
-        // possible to copy the value but it require cross register class copies
-        // and it is expensive.
-        // If cross copy register class is null, then it's not possible to copy
-        // the value at all.
+        // If cross copy register class is null, then it must be possible copy
+        // the value directly. Do not try duplicate the def.
         SUnit *NewDef = 0;
-        if (DestRC != RC) {
+        if (DestRC)
           NewDef = CopyAndMoveSuccessors(LRDef);
-          if (!DestRC && !NewDef)
-            report_fatal_error("Can't handle live physical "
-                               "register dependency!");
-        }
+        else
+          DestRC = RC;
         if (!NewDef) {
           // Issue copies, these can be expensive cross register class copies.
           SmallVector<SUnit*, 2> Copies;
index 5e60aa04eae75c608bdaef33280610d4d921fe8e..f1a5a6599b2a6d765e3ec042507dc6fbbc8e004c 100644 (file)
@@ -1140,19 +1140,13 @@ SUnit *ScheduleDAGRRList::PickNodeToScheduleBottomUp() {
       TRI->getMinimalPhysRegClass(Reg, VT);
     const TargetRegisterClass *DestRC = TRI->getCrossCopyRegClass(RC);
 
-    // If cross copy register class is the same as RC, then it must be possible
-    // copy the value directly. Do not try duplicate the def.
-    // If cross copy register class is not the same as RC, then it's possible to
-    // copy the value but it require cross register class copies and it is
-    // expensive.
-    // If cross copy register class is null, then it's not possible to copy
-    // the value at all.
+    // If cross copy register class is null, then it must be possible copy
+    // the value directly. Do not try duplicate the def.
     SUnit *NewDef = 0;
-    if (DestRC != RC) {
+    if (DestRC)
       NewDef = CopyAndMoveSuccessors(LRDef);
-      if (!DestRC && !NewDef)
-        report_fatal_error("Can't handle live physical register dependency!");
-    }
+    else
+      DestRC = RC;
     if (!NewDef) {
       // Issue copies, these can be expensive cross register class copies.
       SmallVector<SUnit*, 2> Copies;
index 1f464f4be4327bbd206248d5a5d1928959ec902e..fe98cacb836fc71cc9351dc0ec7ed0e5dc2222e8 100644 (file)
@@ -337,7 +337,7 @@ X86RegisterInfo::getCrossCopyRegClass(const TargetRegisterClass *RC) const {
     else
       return &X86::GR32RegClass;
   }
-  return RC;
+  return NULL;
 }
 
 unsigned