mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
[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:
parent
ce69bac886
commit
40ccf16b92
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user