This is an archive of the discontinued LLVM Phabricator instance.

[LV] Change the test cases to ensure that the trip count is not zero. (NFC)
ClosedPublic

Authored by Mel-Chen on Jul 4 2023, 1:28 AM.

Diff Detail

Event Timeline

Mel-Chen created this revision.Jul 4 2023, 1:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2023, 1:28 AM
Mel-Chen requested review of this revision.Jul 4 2023, 1:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 4 2023, 1:28 AM
fhahn accepted this revision.Jul 11 2023, 12:21 PM

LGTM, thanks!

This revision is now accepted and ready to land.Jul 11 2023, 12:21 PM
This revision was landed with ongoing or failed builds.Jul 11 2023, 7:13 PM
This revision was automatically updated to reflect the committed changes.
Ayal added inline comments.Jul 11 2023, 10:14 PM
llvm/test/Transforms/LoopVectorize/select-min-index.ll
23

Note that checking if %iv.next is zero after bumping it with no-wrap flags (having initialized it to zero) is undefined. As is the case now if %n is zero.

Mel-Chen added inline comments.Jul 18 2023, 7:56 PM
llvm/test/Transforms/LoopVectorize/select-min-index.ll
23

If %n is less than or equal to 0, the loop will result in an infinite loop. To handle such cases, what else can I do for these cases? Maybe adding a loop guard to ensure that %n is greater than 0?