[PATCH] D34273: [SCEV] Use depth limit instead of local cache for SExt and ZExt

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 08:22:23 PDT 2017


wmi added inline comments.


================
Comment at: lib/Analysis/ScalarEvolution.cpp:1579
         return getAddRecExpr(
-            getExtendAddRecStart<SCEVZeroExtendExpr>(AR, Ty, this, Cache),
-            getZeroExtendExprCached(Step, Ty, Cache), L, AR->getNoWrapFlags());
+            getExtendAddRecStart<SCEVZeroExtendExpr>(AR, Ty, this),
+            getZeroExtendExpr(Step, Ty, Depth + 1), L, AR->getNoWrapFlags());
----------------
mkazantsev wrote:
> mkazantsev wrote:
> > wmi wrote:
> > > Do we want to pass Depth into getExtendAddRecStart?  Since getZeroExtendExpr and getSignExtendExpr can be called recursively inside of getExtendAddRecStart.
> > Thanks for pointing out! I will go through all invocations here, maybe we are missing it somewhere else.
> Wei, actually I failed to find a place where getAddRecExpr invokes either of them. I only see it invoing itself. We maybe need a separate depth limit for it, but it is out of scope of this patch.
> 
> If you know a way how getSign/ZeroExt can be invoked from getAddRecExpr, could you please point it out?
> 
It is not getAddRecExpr. What I said was getExtendAddRecStart. 


https://reviews.llvm.org/D34273





More information about the llvm-commits mailing list