This is an archive of the discontinued LLVM Phabricator instance.

[test] A test case for D146958
ClosedPublic

Authored by pawosm01 on Mar 27 2023, 8:15 AM.

Details

Summary

This commit introduces a test for the change introduced by the
[SCEV] Do not plant SCEV checks unnecessarily commit,
D146958.

Diff Detail

Event Timeline

pawosm01 created this revision.Mar 27 2023, 8:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2023, 8:15 AM
pawosm01 requested review of this revision.Mar 27 2023, 8:15 AM
pawosm01 retitled this revision from [test] A test case for D146839 to [test] A test case for D146958.Mar 27 2023, 8:16 AM
fhahn added a subscriber: fhahn.Mar 27 2023, 9:10 AM
fhahn added inline comments.
llvm/test/Transforms/LoopVectorize/vector-no-scevcheck.ll
8

entry?

11

Is this load needed or can the value directly be passed as argument?

15

Please shorten the block names and try to make them more descriptive, this will make the test easier to read. E.g. IIUC this could be something like loop1.header.

18

Is this branch needed here?

21

Is this load needed or can the value directly be passed as argument?

26

this could be loop2.header.

31

is this branch needed?

33

This could be loop3.header. Is a 3 level loop nest needed for the test? Would a 2 level loop nest be sufficient?

46

loop2.latch?

51

loop1.latch

56

exit?

Failed as expected.

@fhahn Thanks for your comments. If you don't mind, I will address them in the post-review changes of D146958 in coming day(s).

pawosm01 marked an inline comment as done.Mar 28 2023, 6:58 AM
pawosm01 added inline comments.
llvm/test/Transforms/LoopVectorize/vector-no-scevcheck.ll
31

Yes

pawosm01 updated this revision to Diff 508996.Mar 28 2023, 6:59 AM
pawosm01 marked an inline comment as done.

Test updated as per the reviewer request.

pawosm01 marked 10 inline comments as done.Mar 28 2023, 7:00 AM
pawosm01 added a reviewer: fhahn.
pawosm01 updated this revision to Diff 510825.EditedApr 4 2023, 8:57 AM

seems I had a wrong understanding of the reviewer's intent.

pawosm01 edited the summary of this revision. (Show Details)Apr 4 2023, 10:51 AM
pawosm01 updated this revision to Diff 510861.Apr 4 2023, 11:06 AM

I'll try to build a relation between D146974 and D146958.

xbolva00 added inline comments.
llvm/test/Transforms/LoopVectorize/vector-no-scevcheck.ll
2

This test needs to pass with current master.

Tests are commited as first, so things would be broken.

pawosm01 updated this revision to Diff 510875.Apr 4 2023, 11:55 AM

Following reviewer's advice.

pawosm01 updated this revision to Diff 510877.Apr 4 2023, 11:59 AM

wrong diff file picked; this is the correct one.

Looks OK now. @fhahn ?

pawosm01 marked an inline comment as done.Apr 4 2023, 12:13 PM
pawosm01 edited the summary of this revision. (Show Details)
david-arm accepted this revision.Apr 5 2023, 1:43 AM

LGTM! It looks like you've addressed @fhahn's comments.

This revision is now accepted and ready to land.Apr 5 2023, 1:43 AM
fhahn added inline comments.Apr 5 2023, 2:36 AM
llvm/test/Transforms/LoopVectorize/vector-no-scevcheck.ll
4

could you add a brief comment saying what this test is intended to check?

16

Could you add a new function that's basically the same as @foo but has %arrayidx0 in %loop2.header?

pawosm01 marked an inline comment as done.Apr 17 2023, 7:18 AM
pawosm01 added inline comments.
llvm/test/Transforms/LoopVectorize/vector-no-scevcheck.ll
16

Could you add a new function that's basically the same as @foo but has %arrayidx0 in %loop2.header?

This will not expose the same behavior of the D146958 patch we care about in this test (namely, vector.scevcheck will remain).

pawosm01 marked an inline comment as done.Apr 17 2023, 7:27 AM
pawosm01 updated this revision to Diff 514226.Apr 17 2023, 7:30 AM

a short comment added as requested

pawosm01 marked an inline comment as done.Apr 17 2023, 7:30 AM

Hi @fhahn, are you happy with the current shape?

fhahn added inline comments.Apr 23 2023, 2:34 PM
llvm/test/Transforms/LoopVectorize/vector-no-scevcheck.ll
16

Right, but that's only with the current version of the patch; it should be relatively straightforward to also handle this case (https://reviews.llvm.org/D146958#inline-1439048). In any case, it won't hurt to have negative test cases as well.

mgabka added a subscriber: mgabka.Apr 24 2023, 2:29 AM
pawosm01 updated this revision to Diff 516792.Apr 25 2023, 7:01 AM

Extended with one more variant of the same test case, as requested.

pawosm01 marked an inline comment as done.Apr 25 2023, 7:03 AM
pawosm01 added inline comments.
llvm/test/Transforms/LoopVectorize/vector-no-scevcheck.ll
16

Hi Florian, your suggestion from the patch review has worked, hence I've modified this test file accordingly. I'd like to have your explicit approval before I merge this one.

fhahn accepted this revision.Apr 25 2023, 12:55 PM

LGTM, thanks!

This revision was landed with ongoing or failed builds.Apr 25 2023, 1:37 PM
This revision was automatically updated to reflect the committed changes.
pawosm01 marked an inline comment as done.