This Reassociate change unintentionally slipped in r222499

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222500 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2014-11-21 02:37:38 +00:00
parent 9970214474
commit dac753cb73

View File

@ -394,13 +394,6 @@ static BinaryOperator *LowerNegateToMultiply(Instruction *Neg) {
BinaryOperator *Res = CreateMul(Neg->getOperand(1), NegOne, "", Neg, Neg);
Neg->setOperand(1, Constant::getNullValue(Ty)); // Drop use of op.
Res->takeName(Neg);
if (Ty->isIntegerTy()) {
bool NSW = cast<BinaryOperator>(Neg)->hasNoSignedWrap();
bool NUW = cast<BinaryOperator>(Neg)->hasNoUnsignedWrap();
if (NSW || NUW)
Res->setHasNoSignedWrap(true);
Res->setHasNoUnsignedWrap(NUW);
}
Neg->replaceAllUsesWith(Res);
Res->setDebugLoc(Neg->getDebugLoc());
return Res;