This is an archive of the discontinued LLVM Phabricator instance.

[Test] Add loop deletion switch tests
ClosedPublic

Authored by dmakogon on Jul 7 2021, 3:17 AM.

Diff Detail

Event Timeline

dmakogon requested review of this revision.Jul 7 2021, 3:17 AM
dmakogon created this revision.
mkazantsev requested changes to this revision.Jul 7 2021, 4:20 AM
mkazantsev added inline comments.
llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
1177

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.

1240

Just as above, I'd expect %sub coming from %second_block here to exercise the same scenario as other tests.

This revision now requires changes to proceed.Jul 7 2021, 4:20 AM
mkazantsev added inline comments.Jul 7 2021, 4:26 AM
llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
1190

Please add a test where switch has 2 branches jumping directly to backedge, not to some intermediate block.

dmakogon updated this revision to Diff 357164.Jul 8 2021, 1:54 AM

Now %merge.phi will always equal to %sub instead of a constant in first two test cases.
Added a test in which two switch cases jump to the backedge directly

mkazantsev added inline comments.Jul 8 2021, 2:57 AM
llvm/test/Transforms/LoopDeletion/eval_first_iteration.ll
1150

There is no such block in these tests. Did you forget to re-run update_tests.py?

mkazantsev accepted this revision.Jul 8 2021, 2:59 AM

LGTM w/ test update.

This revision is now accepted and ready to land.Jul 8 2021, 2:59 AM
This revision was landed with ongoing or failed builds.Jul 8 2021, 3:28 AM
This revision was automatically updated to reflect the committed changes.