diff options
author | Tobias Grosser <tobias@grosser.es> | 2016-02-21 18:50:09 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2016-02-21 18:50:09 +0000 |
commit | 934fcf4dc68c5ba2efe395c417759af6564039d5 (patch) | |
tree | 33ed15cb2eefddde80a3c2af538a1f7c23b02320 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 11332e5ec5b8f1e50bdc4e8f3b08b8c35510586f (diff) | |
download | bcm5719-llvm-934fcf4dc68c5ba2efe395c417759af6564039d5.tar.gz bcm5719-llvm-934fcf4dc68c5ba2efe395c417759af6564039d5.zip |
ScalerEvolution: Only erase temporary values if they actually have been added
This addresses post-review comments from Sanjoy Das for r261485.
llvm-svn: 261486
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 6e8fa5d43b2..07d72f5ee20 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -3895,13 +3895,14 @@ 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); } - // 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; } |