[PATCH] D25810: [SCEV] Memoize visitMulExpr results in SCEVRewriteVisitor. Fix PR18606
Li Huang via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 20 17:37:29 PDT 2016
lihuang marked 2 inline comments as done.
lihuang added inline comments.
Comment at: include/llvm/Analysis/ScalarEvolutionExpressions.h:552
+ // Currently only memoize results of visitMulExpr, because other
+ // calculations are much cheaper in the worst case.
+ DenseMap<const SCEV *, const SCEV *> MulRewriteResults;
> Design-wise I'm not too happy to do see this happen only for multiplications -- have you considered over-riding the `visit` function and implementing the general logic there?
Override the visit function in SCEVRewriteVisitor class. This function checks the map first, then forward the input to SCEVVisitor::visit.
More information about the llvm-commits