diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-18 18:20:45 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-18 18:20:45 -0800 |
commit | 24eee40db0cbc4602359e9f25a9787e1d1ced8fb (patch) | |
tree | 4f6f368d8ce8425b05e2967c362242a46523c5ea /lib/Transforms | |
parent | 7db0b7b0f653bf0735e8b6c4f50c959eb49f456d (diff) |
be more careful about sext/zext of i32 to i64, the input element may be modified, so copy it
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/NaCl/ExpandI64.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/NaCl/ExpandI64.cpp b/lib/Transforms/NaCl/ExpandI64.cpp index 271c534686..9febcd0ce4 100644 --- a/lib/Transforms/NaCl/ExpandI64.cpp +++ b/lib/Transforms/NaCl/ExpandI64.cpp @@ -224,7 +224,7 @@ void ExpandI64::splitInst(Instruction *I, DataLayout& DL) { if (T->getIntegerBitWidth() < 32) { Low = CopyDebug(new SExtInst(Input, i32, "", I), I); } else { - Low = Input; + Low = CopyDebug(BinaryOperator::Create(Instruction::Or, Input, Zero, "", I), I); // copy the input, hackishly XXX } Instruction *Check = CopyDebug(new ICmpInst(I, ICmpInst::ICMP_SLT, Low, Zero), I); Instruction *High = CopyDebug(SelectInst::Create(Check, Ones, Zero, "", I), I); @@ -240,7 +240,7 @@ void ExpandI64::splitInst(Instruction *I, DataLayout& DL) { if (T->getIntegerBitWidth() < 32) { Low = CopyDebug(new ZExtInst(Input, i32, "", I), I); } else { - Low = Input; + Low = CopyDebug(BinaryOperator::Create(Instruction::Or, Input, Zero, "", I), I); // copy the input, hackishly XXX } SplitInfo &Split = Splits[I]; Split.LowHigh.Low = Low; |