[llvm] [LoopPeel] Peel last iteration to enable load widening (PR #173420)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 12 03:28:48 PST 2026


================
@@ -1316,6 +1324,12 @@ tryToUnrollLoop(Loop *L, DominatorTree &DT, LoopInfo *LI, ScalarEvolution &SE,
     ValueToValueMapTy VMap;
     if (peelLoop(L, PP.PeelCount, PP.PeelLast, LI, &SE, DT, &AC, PreserveLCSSA,
                  VMap)) {
+      // Widen consecutive loads after last-iteration peeling
+      if (PP.PeelLast) {
+        const DataLayout &DL = L->getHeader()->getDataLayout();
+        widenLoadsAfterPeel(*L, SE, DL, TTI, DT);
----------------
fhahn wrote:

no need to pass DL, can get in the caller as well directly from L

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


More information about the llvm-commits mailing list