Revert r203883 (which was more of a bandaid) and fix the real underlying
authorOwen Anderson <resistor@mac.com>
Fri, 14 Mar 2014 05:02:18 +0000 (05:02 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 14 Mar 2014 05:02:18 +0000 (05:02 +0000)
issue in that the new MachineRegisterInfo bundle iterators didn't
dereference to the START of the bundle, while the old skipBundle()
method did.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203890 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineRegisterInfo.h
lib/CodeGen/InlineSpiller.cpp

index dd9e2803bd2ee926a1b4315b5cb8f2b26440e740..9a49b19316ace24448de80cb755eb0ae76b6beda 100644 (file)
@@ -856,11 +856,13 @@ public:
     // Retrieve a reference to the current operand.
     MachineInstr &operator*() const {
       assert(Op && "Cannot dereference end iterator!");
+      if (ByBundle) return *(getBundleStart(Op->getParent()));
       return *Op->getParent();
     }
 
     MachineInstr *operator->() const {
       assert(Op && "Cannot dereference end iterator!");
+      if (ByBundle) return getBundleStart(Op->getParent());
       return Op->getParent();
     }
   };
index 5bf7b112869db2fd136809ffa2b939b4ea550000..64211c8d31b76237823697ea15748a709a1fc31c 100644 (file)
@@ -1196,7 +1196,7 @@ void InlineSpiller::spillAroundUses(unsigned Reg) {
   for (MachineRegisterInfo::reg_bundle_iterator
        RegI = MRI.reg_bundle_begin(Reg), E = MRI.reg_bundle_end();
        RegI != E; ) {
-    MachineInstr *MI = getBundleStart(&*(RegI++));
+    MachineInstr *MI = &*(RegI++);
 
     // Debug values are not allowed to affect codegen.
     if (MI->isDebugValue()) {