[regallocfast] Make sure the MachineRegisterInfo is aware of clobbers from a
authorChad Rosier <mcrosier@apple.com>
Tue, 6 Nov 2012 22:52:42 +0000 (22:52 +0000)
committerChad Rosier <mcrosier@apple.com>
Tue, 6 Nov 2012 22:52:42 +0000 (22:52 +0000)
register masks.  This is an obvious and necessary fix for a soon to be committed
patch.  No test case possible at this time.  Reviewed by Jakob.

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

lib/CodeGen/RegAllocFast.cpp

index e426fe23c005688b3c03bc00cc148dffba7f1553..88922169b306c0672278a7ebead53966c2590ee6 100644 (file)
@@ -956,6 +956,11 @@ void RAFast::AllocateBasicBlock() {
     bool hasPhysDefs = false;
     for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
       MachineOperand &MO = MI->getOperand(i);
+      // Make sure MRI knows about registers clobbered by regmasks.
+      if (MO.isRegMask()) {
+        MRI->addPhysRegsUsedFromRegMask(MO.getRegMask());
+        continue;
+      }
       if (!MO.isReg()) continue;
       unsigned Reg = MO.getReg();
       if (!Reg) continue;