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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 25 22:47:42 PDT 2018


mkazantsev 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) {
+
----------------
anna wrote:
> 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?
I haven't added these cases for `X - (X + C1)`, they were here before, I've just refactored and commented the code slightly. :) But OK, I will add some tests on these situations.


https://reviews.llvm.org/D43759





More information about the llvm-commits mailing list