forked from OSchip/llvm-project
[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
This commit is contained in:
parent
2345dbbd54
commit
469e740f2b
|
@ -415,9 +415,6 @@ void SCEVUnknown::deleted() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCEVUnknown::allUsesReplacedWith(Value *New) {
|
void SCEVUnknown::allUsesReplacedWith(Value *New) {
|
||||||
// Clear this SCEVUnknown from various maps.
|
|
||||||
SE->forgetMemoizedResults(this);
|
|
||||||
|
|
||||||
// Remove this SCEVUnknown from the uniquing map.
|
// Remove this SCEVUnknown from the uniquing map.
|
||||||
SE->UniqueSCEVs.RemoveNode(this);
|
SE->UniqueSCEVs.RemoveNode(this);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue