[PATCH] D55232: [SCEV] Suppress hoisting insertion point of binops when unsafe

Warren Ristow via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 16:54:24 PDT 2019


wristow updated this revision to Diff 192943.
wristow added a comment.

>> Limiting to constants looks super-conservative. How about getting SCEV for RHS and then asking SE `isKnownPredicate(ICMP_NE, RHS, 0)`?
> 
> Sounds good. ... In any case, until the fix that was done as rL347934 <https://reviews.llvm.org/rL347934> is re-instated in some form, I'll hold off on making the fix discussed here.

That fix has been reinstated at r356392 (D57428 <https://reviews.llvm.org/D57428>) so I'm now addressing this issue.

Taking the suggestion of `isKnownPredicate(ICMP_NE, RHS, 0)` from @mkazantsev, I see that for this situation, `SE.isKnownNonZero(S->getRHS())` can be used.  The resulting patch is then simpler than my original patch proposed here, and it adds the more aggressive analysis Max suggested.  I've added additional tests in this update, which includes testing for that more aggressive behavior of the hoisting of a non-constant divisor that can be proven to be non-zero.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55232/new/

https://reviews.llvm.org/D55232

Files:
  include/llvm/Analysis/ScalarEvolutionExpander.h
  lib/Analysis/ScalarEvolutionExpander.cpp
  test/Transforms/LoopVectorize/pr38697.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55232.192943.patch
Type: text/x-patch
Size: 15014 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190329/f3f3b702/attachment.bin>


More information about the llvm-commits mailing list