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. llvm-svn: 210048
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user