diff options
author | Tobias Grosser <tobias@grosser.es> | 2016-02-21 17:42:10 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2016-02-21 17:42:10 +0000 |
commit | 11332e5ec5b8f1e50bdc4e8f3b08b8c35510586f (patch) | |
tree | 510fc63ab8bd3d974f4a05f889a11c854148f917 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 2440130437320c9671f842a933548a57dbaf5184 (diff) | |
download | bcm5719-llvm-11332e5ec5b8f1e50bdc4e8f3b08b8c35510586f.tar.gz bcm5719-llvm-11332e5ec5b8f1e50bdc4e8f3b08b8c35510586f.zip |
ScalarEvolution: Do not keep temporary PHI values in ValueExprMap
Before this patch simplified SCEV expressions for PHI nodes were only returned
the very first time getSCEV() was called, but later calls to getSCEV always
returned the non-simplified value, which had "temporarily" been stored in the
ValueExprMap, but was never removed and consequently blocked the caching of the
simplified PHI expression.
llvm-svn: 261485
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 4c3c5c7c7fb..6e8fa5d43b2 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -3897,6 +3897,11 @@ const SCEV *ScalarEvolution::createAddRecFromPHI(PHINode *PN) { } } + // Remove the temporary PHI node SCEV that has been inserted while intending + // to create an AddRecExpr for this PHI node. We can not keep this temporary + // as it will prevent later (possibly simpler) SCEV expressions to be added + // to the ValueExprMap. + ValueExprMap.erase(PN); return nullptr; } |