[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 Feb 12 01:05:05 PST 2018


sbaranga added a comment.

LGTM with one minor nit.



================
Comment at: lib/Analysis/ScalarEvolution.cpp:11548
   // return \p Expr.
   const SCEV *convertToAddRecWithPreds(const SCEVUnknown *Expr) {
     if (!isa<PHINode>(Expr->getValue()))
----------------
Not related to this change, but it might be worth not processing Expr if it is invariant in L.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:11558
+      if (auto *WP = dyn_cast<const SCEVWrapPredicate>(P))
+        if (auto *AR = dyn_cast<const SCEVAddRecExpr>(WP->getExpr()))
+          if (L != AR->getLoop())
----------------
This should be cast<> instead of dyn_cast since WP->getExpr() is always an AddRecExpr.


Repository:
  rL LLVM

https://reviews.llvm.org/D42604





More information about the llvm-commits mailing list