[PATCH] D42604: PR36032 fix assert cause by not computed SCEV PredicatedBackEdgeCount

silviu.baranga@arm.com via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 01:13:01 PST 2018


sbaranga added a comment.

Thanks for submitting the fix! Please see the inline comments.

Silviu



================
Comment at: lib/Analysis/ScalarEvolution.cpp:4657
+    SCEVUnionPredicate Pred;
+    if (isa<SCEVCouldNotCompute>(getPredicatedBackedgeTakenCount(L, Pred)))
+      return None;
----------------
This assumes that L is a sub-loop of the loop being processed by the rewriter.

To make this correct you would also have to add the predicates returned by getPredicatedBackedgeTakenCount to the set of returned predicates.

I think this function might also get called from getPredicatedBackedgeTakenCount and might result in an infinite loop.

I think there is an easier solution (see the comment below).


================
Comment at: lib/Analysis/ScalarEvolution.cpp:11500
     for (auto *P : PredicatedRewrite->second){
       if (!addOverflowAssumption(P))
         return Expr;
----------------
I think at least for now the fix can be done here, and should check that all overflow predicates are done on L (the loop currently being processed by the rewriter).


Repository:
  rL LLVM

https://reviews.llvm.org/D42604





More information about the llvm-commits mailing list