[PATCH] D137632: [LoopPredication] Widen checks if condition operands constant ranges are known

Dmitry Makogon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 04:02:21 PST 2022


dmakogon created this revision.
dmakogon added reviewers: mkazantsev, nikic, apilipenko, asbirlea, reames.
Herald added a subscriber: hiraditya.
Herald added a project: All.
dmakogon requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This enables LoopPredication to widen checks of the following form:

  x < guardLimit,

where x and guardLimit have known constant ranges (meaning they are not
full-set). If they are reasonably small and max(x) <= max(guardLimit), we
can predicate the loop with the condition max(x) <= guardLimit.


https://reviews.llvm.org/D137632

Files:
  llvm/lib/Transforms/Scalar/LoopPredication.cpp
  llvm/test/Transforms/LoopPredication/constant-ranges.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137632.473953.patch
Type: text/x-patch
Size: 19095 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221108/3b44a8ca/attachment.bin>


More information about the llvm-commits mailing list