summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2017-07-26 01:32:19 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2017-07-26 01:32:19 +0000
commit469e740f2b7cc3254b6187f637a4411acc325f12 (patch)
tree642164f4b60a3415d8cb037d14f148d5b8af41c2
parent2345dbbd546a1151f75a4be47f0b1b09506cf578 (diff)
downloadbcm5719-llvm-469e740f2b7cc3254b6187f637a4411acc325f12.tar.gz
bcm5719-llvm-469e740f2b7cc3254b6187f637a4411acc325f12.zip
[SCEV] Remove unnecessary call to forgetMemoizedResults
`SCEVUnknown::allUsesReplacedWith` does not need to call `forgetMemoizedResults` since RAUW does a value-equivalent replacement by assumption. If this assumption was false then the later setValPtr(New) call would be incorrect too. This is a non-trivial performance optimization for functions with a large number of loops since `forgetMemoizedResults` walks all loop backedge taken counts to see if any of them use the SCEVUnknown being RAUWed. However, this improvement is difficult to demonstrate without checking in an excessively large IR file. llvm-svn: 309072
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index b726fd97b70..4d7b59c4763 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -415,9 +415,6 @@ void SCEVUnknown::deleted() {
}
void SCEVUnknown::allUsesReplacedWith(Value *New) {
- // Clear this SCEVUnknown from various maps.
- SE->forgetMemoizedResults(this);
-
// Remove this SCEVUnknown from the uniquing map.
SE->UniqueSCEVs.RemoveNode(this);
OpenPOWER on IntegriCloud