[llvm] LoopLoadElim: don't version single-iteration loops (PR #97599)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 02:33:18 PDT 2024


================
@@ -598,10 +598,11 @@ class LoadEliminationForLoop {
       }
 
       // Point of no-return, start the transformation.  First, version the loop
-      // if necessary.
-
-      LoopVersioning LV(LAI, Checks, L, LI, DT, PSE.getSE());
-      LV.versionLoop();
+      // if it's not a single-iteration loop.
+      if (!PSE.getBackedgeTakenCount()->isOne()) {
----------------
artagnon wrote:

Sorry about this huge confusion and mess. It looks like, with a single iteration, LLE doesn't version the loop. I think the regression is observed when BTC = 1. Investigating further.

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


More information about the llvm-commits mailing list