Revert "Add the nsw flag when we detect that an add will not signed overflow."

This reverts commit r210029.

It was not correctly handling cases where LHS and RHS had multiple but different
sign bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210048 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2014-06-02 21:12:19 +00:00
parent 8962f1959d
commit 2e1c072976
7 changed files with 12 additions and 17 deletions

View File

@ -1191,11 +1191,6 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
return BinaryOperator::CreateOr(A, B);
}
if (!I.hasNoSignedWrap() && WillNotOverflowSignedAdd(LHS, RHS)) {
Changed = true;
I.setHasNoSignedWrap(true);
}
return Changed ? &I : nullptr;
}