[llvm] [SCEV][LV] Invalidate LCSSA exit phis more thoroughly (PR #69909)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 15 07:16:20 PST 2023
================
@@ -8408,6 +8408,35 @@ void ScalarEvolution::forgetValue(Value *V) {
forgetMemoizedResults(ToForget);
}
+void ScalarEvolution::forgetLcssaPhiWithNewPredecessor(PHINode *V) {
+ // If SCEV looked through a trivial LCSSA phi node, we might have SCEV's
+ // directly using a SCEVUnknown defined in the loop. After an extra
+ // predecessor is added, this is no longer valid. Find all SCEVUnknown's
+ // defined in the loop and invalidate any SCEV's making use of them.
+ if (isSCEVable(V->getType())) {
+ if (const SCEV *S = getExistingSCEV(V)) {
+ struct SCEVUnknownCollector {
+ SmallVector<const SCEV *, 8> Unknowns;
+
+ bool follow(const SCEV *S) {
+ // This could be restricted to unknowns defined in the loop.
----------------
fhahn wrote:
Should this be a TODO?
https://github.com/llvm/llvm-project/pull/69909
More information about the llvm-commits
mailing list