This fixes the regression reported against D111533. I don't actually believe this is a regression, but trying to message things enough to trigger without that change doesn't seem particular worthwhile either.
Details
Diff Detail
Event Timeline
The idea here is right, but I'm concerned that this will have pathological cases, because we need to scan the whole ValuesAtScopes map any time we forget something. This map can be large. The proper way to handle this would be to add a reverse map for invalidation purposes (similar to D114784, but for ValuesAtScope).
llvm/lib/Analysis/ScalarEvolution.cpp | ||
---|---|---|
12897 | Should be easy to do with llvm::remove_if(). |
Implementation using reverse map up at D114788.
Mild compile-time effect can already be seen for the average case, and would probably be much worse (quadratic) for degenerate cases:
This patch: https://llvm-compile-time-tracker.com/compare.php?from=eee035235ebd76b0e1b62f6dec989874a3102233&to=96a6af0ec6a64c58dea81c71cb8e3b8f04c7e1b6&stat=instructions
Reverse map: https://llvm-compile-time-tracker.com/compare.php?from=72d45d2131f55751be7654e5d13115fe5b150dbb&to=a653588a31f275b318f1fbe6be0c274b2acf1e22&stat=instructions
Should be easy to do with llvm::remove_if().