ScalerEvolution: Only erase temporary values if they actually have been added

This addresses post-review comments from Sanjoy Das for r261485.

llvm-svn: 261486
This commit is contained in:
Tobias Grosser 2016-02-21 18:50:09 +00:00
parent 11332e5ec5
commit 934fcf4dc6
1 changed files with 6 additions and 5 deletions

View File

@ -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;
}