[NFC] more comments in SLSR

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239984 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jingyue Wu 2015-06-18 03:35:57 +00:00
parent ce69bac886
commit 40ccf16b92

View File

@ -632,6 +632,15 @@ void StraightLineStrengthReduce::rewriteCandidateWithBasis(
// trivially dead.
RecursivelyDeleteTriviallyDeadInstructions(Bump);
} else {
// It's tempting to preserve nsw on Bump and/or Reduced. However, it's
// usually unsound, e.g.,
//
// X = (-2 +nsw 1) *nsw INT_MAX
// Y = (-2 +nsw 3) *nsw INT_MAX
// =>
// Y = X + 2 * INT_MAX
//
// Neither + and * in the resultant expression are nsw.
Reduced = Builder.CreateAdd(Basis.Ins, Bump);
}
break;