Mark tADDrSPi as having side effects again.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 15 Oct 2011 00:57:13 +0000 (00:57 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 15 Oct 2011 00:57:13 +0000 (00:57 +0000)
It really doesn't, but when r141929 removed the hasSideEffects flag from
this instruction, it caused miscompilations.  I am guessing that it got
moved across a stack pointer update.

Also clear isRematerializable after checking that this instruction is
in fact never rematerialized in the nightly test suite.

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

lib/Target/ARM/ARMInstrThumb.td

index 3e81516726b8466fa9564a1f0ad58ca26f1e6b85..cedb54799db0dbe83c237ff9456b1eae996def18 100644 (file)
@@ -310,9 +310,9 @@ def tPICADD : TIt<(outs GPR:$dst), (ins GPR:$lhs, pclabel:$cp), IIC_iALUr, "",
 }
 
 // ADD <Rd>, sp, #<imm8>
-// This is rematerializable, which is particularly useful for taking the
-// address of locals.
-let isReMaterializable = 1, neverHasSideEffects = 1 in
+// FIXME: This should not be marked as having side effects, and it should be
+// rematerializable. Clearing the side effect bit causes miscompilations,
+// probably because the instruction can be moved around.
 def tADDrSPi : T1pI<(outs tGPR:$dst), (ins GPRsp:$sp, t_imm0_1020s4:$imm),
                     IIC_iALUi, "add", "\t$dst, $sp, $imm", []>,
                T1Encoding<{1,0,1,0,1,?}> {