[PATCH] D116150: [SCEV] Use lshr in implications

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 22 02:44:25 PST 2021


mkazantsev created this revision.
mkazantsev added reviewers: nikic, lebedev.ri, fhahn, reames.
Herald added a subscriber: hiraditya.
mkazantsev requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch adds support for implication inference logic for the
following pattern:

  lhs < (y >> z) <= y, y <= rhs --> lhs < rhs

We should be able to use the fact that value shifted to right is
not greater than the original value (provided it is non-negative).


https://reviews.llvm.org/D116150

Files:
  llvm/include/llvm/Analysis/ScalarEvolution.h
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Transforms/IndVarSimplify/shift-range-checks.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116150.395820.patch
Type: text/x-patch
Size: 6717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211222/23943a46/attachment.bin>


More information about the llvm-commits mailing list