[PATCH] D89548: [SCEV] Prove implications of different type via truncation

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 21:51:17 PDT 2020


mkazantsev added inline comments.


================
Comment at: llvm/test/Analysis/ScalarEvolution/srem.ll:32
 ; CHECK-NEXT:    %inc = add nsw i32 %i.0, 1
-; CHECK-NEXT:    --> {1,+,1}<nuw><%for.cond> U: [1,0) S: [1,0) Exits: (1 + %width) LoopDispositions: { %for.cond: Computable }
+; CHECK-NEXT:    --> {1,+,1}<nuw><%for.cond> U: full-set S: full-set Exits: (1 + %width) LoopDispositions: { %for.cond: Computable }
 ; CHECK-NEXT:  Determining loop execution counts for: @_Z4loopi
----------------
mkazantsev wrote:
> fhahn wrote:
> > mkazantsev wrote:
> > > mkazantsev wrote:
> > > > Bug in underpying patch.
> > > It happens just because we create zero extend SCEV (and not proving further ule). A subject for a follow-up fix.
> > It would probably be good to have a fix lined up before this goes in
> Agreed, I'm looking into it. Thanks!
Root cause here: by the moment when we query this, `nuw` flag is not set and one of rules in range computation does not apply. General problem: we don't drop constant ranges when we update flags when we should.


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

https://reviews.llvm.org/D89548



More information about the llvm-commits mailing list