Transfer implicit ops when forming load multiple and return instructions.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 22 Oct 2010 21:29:58 +0000 (21:29 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 22 Oct 2010 21:29:58 +0000 (21:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117151 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h
lib/CodeGen/SimpleRegisterCoalescing.cpp
lib/Target/ARM/ARMLoadStoreOptimizer.cpp

index f843196105dd942a7c4edd6c60c11463f9541efa..fc84f8c9531328095c6a658b128015887d5aab79 100644 (file)
@@ -416,6 +416,10 @@ public:
   ///
   bool allDefsAreDead() const;
 
+  /// copyImplicitOps - Copy implicit register operands from specified
+  /// instruction to this instruction.
+  void copyImplicitOps(const MachineInstr *MI);
+
   //
   // Debugging support
   //
index 2f73551aa6df39b50c757de6b09d718d1ba062ab..3b7b4d218d2e76346d1a2cc238d44724e5d11ca2 100644 (file)
@@ -680,7 +680,7 @@ bool SimpleRegisterCoalescing::ReMaterializeTrivialDef(LiveInterval &SrcInt,
       RemoveCopyFlag(MO.getReg(), CopyMI);
   }
 
-  TransferImplicitOps(CopyMI, NewMI);
+  NewMI->copyImplicitOps(CopyMI);
   li_->ReplaceMachineInstrInMaps(CopyMI, NewMI);
   CopyMI->eraseFromParent();
   ReMatCopies.insert(CopyMI);
index a7d1d9f3fbd34319e9cdd9c20aea9704bd14ba2f..6b9e75f95d3963d26b3a64a60b08030240855b1f 100644 (file)
@@ -1196,6 +1196,7 @@ bool ARMLoadStoreOpt::MergeReturnIntoLDM(MachineBasicBlock &MBB) {
       unsigned NewOpc = isThumb2 ? ARM::t2LDM_RET : ARM::LDM_RET;
       PrevMI->setDesc(TII->get(NewOpc));
       MO.setReg(ARM::PC);
+      PrevMI->copyImplicitOps(&*MBBI);
       MBB.erase(MBBI);
       return true;
     }