[PATCH] D105543: [Test] Add loop deletion switch tests

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 7 04:20:33 PDT 2021


mkazantsev requested changes to this revision.
mkazantsev added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll:1177
+backedge:
+  %merge.phi = phi i32 [ %sub, %default ], [ 0, %onzero ], [ 1, %onone ], [ 2, %ontwo ]
+  %sum.next = add i32 %sum, %merge.phi
----------------
If you want this test to exercise the same scenario as the other tests here, I guess you want `%sub` to be coming from `%ontwo`. In this case, `%merge.phi` will simplify to `%sub` and not to `2`. And then `%sum.next` should simplify to `sum + sub = sum + 2 - sum = 2`.

In your version, `sum` just happens to match `2`, but I'm not sure if it was the intention of this test.


================
Comment at: llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll:1240
+backedge:
+  %merge.phi = phi i32 [ %sub, %default ], [ 1, %first_block ], [ 4, %second_block ]
+  %sum.next = add i32 %sum, %merge.phi
----------------
Just as above, I'd expect `%sub` coming from `%second_block` here to exercise the same scenario as other tests.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105543/new/

https://reviews.llvm.org/D105543



More information about the llvm-commits mailing list