diff options
| author | Jingyue Wu <jingyue@google.com> | 2015-06-18 03:35:57 +0000 |
|---|---|---|
| committer | Jingyue Wu <jingyue@google.com> | 2015-06-18 03:35:57 +0000 |
| commit | a941129d006e41d9f59e81d7f2fef631766a4464 (patch) | |
| tree | 3d4940f52daf167e10a9eb1f89e2a966d226f78b | |
| parent | a89468b4b5f8ab7a1e93df2024b3fc0fb0310235 (diff) | |
| download | bcm5719-llvm-a941129d006e41d9f59e81d7f2fef631766a4464.tar.gz bcm5719-llvm-a941129d006e41d9f59e81d7f2fef631766a4464.zip | |
[NFC] more comments in SLSR
llvm-svn: 239984
| -rw-r--r-- | llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp index 8e5cf46263e..f32769c2411 100644 --- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp @@ -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; |

