[llvm] [LoopFuse] Don't preserve SCEV analysis (PR #153547)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 14 03:53:34 PDT 2025


================
@@ -314,7 +314,7 @@ struct FusionCandidate {
   /// Determine if a fusion candidate (representing a loop) is eligible for
   /// fusion. Note that this only checks whether a single loop can be fused - it
   /// does not check whether it is *legal* to fuse two loops together.
-  bool isEligibleForFusion(ScalarEvolution &SE) const {
+  bool isEligibleForFusion(ScalarEvolution &SE, bool VerifySCEV = true) const {
----------------
Meinersbur wrote:

Please document what the additional parameter is for. In this case, it is to skip a check in an assertion after the transformation where SE must be considered invalidated, which means that with `VerifySCEV=false`, the loop cannot be considered eligible for fusion. Therefore, consider renaming it `SkipSCEVChecks`. 

https://github.com/llvm/llvm-project/pull/153547


More information about the llvm-commits mailing list