Fix a typo where we were creating <def,kill> operands instead of
authorLang Hames <lhames@gmail.com>
Fri, 22 Nov 2013 00:46:32 +0000 (00:46 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 22 Nov 2013 00:46:32 +0000 (00:46 +0000)
<def,dead> ones.

Add an assertion to make sure we catch this in the future.

Fixes <rdar://problem/15464559>.

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

include/llvm/CodeGen/MachineOperand.h
lib/Target/ARM/ARMBaseInstrInfo.cpp

index 57b28fecf8640253100077aec34fbc3f462547cf..40f3580bfdb49a9e40d9dd157aa4c44d8cd1a214 100644 (file)
@@ -564,6 +564,8 @@ public:
                                   unsigned SubReg = 0,
                                   bool isDebug = false,
                                   bool isInternalRead = false) {
+    assert(!(isDead && !isDef) && "Dead flag on non-def");
+    assert(!(isKill && isDef) && "Kill flag on def");
     MachineOperand Op(MachineOperand::MO_Register);
     Op.IsDef = isDef;
     Op.IsImp = isImp;
index b2dd9d85e52a67440fcd41d47149c76c0aaa2e81..67534c4a44570ef37e41e9ed981136a2c8566655 100644 (file)
@@ -1934,7 +1934,8 @@ bool llvm::tryFoldSPUpdateIntoPushPop(MachineFunction &MF,
       return false;
 
     // Mark the unimportant registers as <def,dead> in the POP.
-    RegList.push_back(MachineOperand::CreateReg(CurReg, true, false, true));
+    RegList.push_back(MachineOperand::CreateReg(CurReg, true, false, false,
+                                                true));
   }
 
   if (RegsNeeded > 0)