[llvm] [LoopFuse] Don't preserve SCEV analysis (PR #153547)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 14 00:23:32 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Madhur Amilkanthwar (madhur13490)
<details>
<summary>Changes</summary>
This patch fixes the issue while verifying SCEV.
As the loops are fused, SCEV information is not valid, and rather than recomputing it in the pass,
We should prefer to let the pass manager recompute it for us when the next pass request it.
When there is no fusion, all analyses are preserved.
Fixes #<!-- -->115279
---
Full diff: https://github.com/llvm/llvm-project/pull/153547.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/Scalar/LoopFuse.cpp (-4)
``````````diff
diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
index b5eb647a042b9..34d3abe0429ab 100644
--- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
@@ -639,7 +639,6 @@ struct LoopFuser {
assert(DT.verify());
assert(PDT.verify());
LI.verify(DT);
- SE.verify();
#endif
LLVM_DEBUG(dbgs() << "Loop Fusion complete\n");
@@ -1786,7 +1785,6 @@ struct LoopFuser {
assert(DT.verify(DominatorTree::VerificationLevel::Fast));
assert(PDT.verify());
LI.verify(DT);
- SE.verify();
#endif
LLVM_DEBUG(dbgs() << "Fusion done:\n");
@@ -2082,7 +2080,6 @@ struct LoopFuser {
assert(DT.verify(DominatorTree::VerificationLevel::Fast));
assert(PDT.verify());
LI.verify(DT);
- SE.verify();
#endif
LLVM_DEBUG(dbgs() << "Fusion done:\n");
@@ -2122,7 +2119,6 @@ PreservedAnalyses LoopFusePass::run(Function &F, FunctionAnalysisManager &AM) {
PreservedAnalyses PA;
PA.preserve<DominatorTreeAnalysis>();
PA.preserve<PostDominatorTreeAnalysis>();
- PA.preserve<ScalarEvolutionAnalysis>();
PA.preserve<LoopAnalysis>();
return PA;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/153547
More information about the llvm-commits
mailing list