[PATCH] D100566: [SCEV] Add a ah-hoc pattern on isImpliedCondBalancedTypes

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 15 08:06:46 PDT 2021


jaykang10 created this revision.
jaykang10 added reviewers: reames, sanwou01.
Herald added subscribers: javed.absar, hiraditya.
jaykang10 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

I have seen some cases which SCEV's `isImpliedCond` returns false.

It looks `isImpliedCond' has no patterns for case which the FoundLHS or FoundRHS is AddRec and the LHS and RHS are not AddRec.

In order to handle this case, we can use below one.

If FoundRHS is AddRec and FoundPred is EQ, we can say

      

The min value of FoundRHS is AddRec's start value if and only if "AddRec == FoundRHS" is true.

      

It means we can use "FoundRHS >= AddRec's start value" for "AddRec == FoundRHS".

This changes helps IRCE pass handles cascaded sibling loops.


https://reviews.llvm.org/D100566

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp
  llvm/test/Transforms/IRCE/sibling_loops.ll
  llvm/test/Transforms/IndVarSimplify/ARM/indvar-cost.ll
  llvm/test/Transforms/IndVarSimplify/lftr-pr20680.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100566.337767.patch
Type: text/x-patch
Size: 9767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210415/fba40d77/attachment.bin>


More information about the llvm-commits mailing list