This is an archive of the discontinued LLVM Phabricator instance.

[IRCE] Refactor parseRangeCheckICmp
ClosedPublic

Authored by aleksandr.popov on Apr 19 2023, 8:46 AM.

Details

Summary

Simplify parseRangeCheckICmp:

  • If RHS is loop-variant, swap LHS/RHS and swap predicate
  • all checks are either IV >(=) const or IV <(=) RHS (maybe not const)

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 8:46 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
aleksandr.popov requested review of this revision.Apr 19 2023, 8:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 8:46 AM
mkazantsev requested changes to this revision.Apr 21 2023, 1:13 AM
mkazantsev added inline comments.
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
275

Now you can change Index and return false, which was not the case in the old implementation.

This revision now requires changes to proceed.Apr 21 2023, 1:13 AM
mkazantsev added inline comments.Apr 21 2023, 1:13 AM
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
271

{ } not needed

Now you can change Index and return false, which was not the case in the old implementation.

Ok, updated the diff to make it more straightforward

mkazantsev accepted this revision.Apr 21 2023, 3:00 AM

LG, thanks

This revision is now accepted and ready to land.Apr 21 2023, 3:00 AM
This revision was automatically updated to reflect the committed changes.