[PATCH] D53061: [IndVars] Drop "exact" flag from lshr and udiv when substituting their args

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 11 00:11:02 PDT 2018


mkazantsev added inline comments.


================
Comment at: test/Transforms/IndVarSimplify/drop-exact.ll:8
+; we drop "exact" flag on lshr as we do it.
+define void @test(i32* %p, i64* %p1) {
+; CHECK-LABEL: @test(
----------------
sanjoy wrote:
> Are there existing tests demonstrating that we do keep `exact` when legal?  If not, would be nice to add one.
I tried playing with that, and I noticed that cases like `%tmp21 = add nsw i32 %tmp17, 0` (for which that would have been legal to keep it) get optimized away earlier by other parts of IndVars, so this instruction doesn't live long enough. I will study whether or not it is possible to come here with something like this at all, and if not, I will just remove the check and drop `exact` unconditionally.


https://reviews.llvm.org/D53061





More information about the llvm-commits mailing list