[PATCH] D43759: [SCEV] Add one more case in computeConstantDifference

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 23 11:05:01 PDT 2018


anna added inline comments.


================
Comment at: test/Transforms/IndVarSimplify/promote-iv-to-eliminate-casts.ll:105
+
+define void @promote_latch_condition_decrementing_loop_01(i32* %p, i32* %a) {
+
----------------
IIUC, this test uses the logic in `computeConstantDifference` for (X + C2) - (X + C1)`.
Is it possible to add tests for the other rules that you've added:
`X - (X+ C1)`. 
That should just be setting iv to len (instead of len.minus.1). That's an out of bounds, but something along these lines should work as a test right?


https://reviews.llvm.org/D43759





More information about the llvm-commits mailing list