[PATCH] D47087: [ScopHelper] Cache ScopExpander results.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 15:42:26 PDT 2018


Meinersbur added a comment.

SCEVExpander itself already has a cache. For some reason (I don't understand myself) ScopExpander recursively visits the SCEV before calling into SCEVExpander (and in the process expands subelements itself, then converts it back using `getSCEV`?!!!?). The SCEV has already been visited even before `polly::expandCodeFor` is called in `trySynthesizeNewValue` to replace original (non-SCEV) values by generated ones.

Usually, it's `SCEVRewriteVisitor`'s job to do the cached, which the pre-process pass of `SCEVExpander` does not use.

Ideally, the caching (e.g. by SCEVExpander) should happen on BB-level. That is, `BlockGenerator` should hold the ScopExpander, such that `expandCodeFor` does not start with a clear cache every time it is called.

I know this is a lot of work, so I am fine with this as a quick fix.


Repository:
  rPLO Polly

https://reviews.llvm.org/D47087





More information about the llvm-commits mailing list