[llvm] [LoopFusion] Remove unused DataLayout parameter (NFC) (PR #202009)

Madhur Amilkanthwar via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 23:29:50 PDT 2026


https://github.com/madhur13490 created https://github.com/llvm/llvm-project/pull/202009

The LoopFuser constructor took a DataLayout reference that was never stored or used, and run() computed it solely to pass it in. Drop both.

>From 4b1f6b9a5e58e7ecba4eecc97b70e9267707d7d5 Mon Sep 17 00:00:00 2001
From: Madhur Amilkanthwar <madhura at nvidia.com>
Date: Fri, 5 Jun 2026 01:33:42 -0700
Subject: [PATCH] [LoopFusion] Remove unused DataLayout parameter (NFC)

The LoopFuser constructor took a DataLayout reference that was never
stored or used, and run() computed it solely to pass it in. Drop both.
---
 llvm/lib/Transforms/Scalar/LoopFuse.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
index 3263d8b40aa83..aa07ec0f3611d 100644
--- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
@@ -470,8 +470,8 @@ struct LoopFuser {
 public:
   LoopFuser(LoopInfo &LI, DominatorTree &DT, DependenceInfo &DI,
             ScalarEvolution &SE, PostDominatorTree &PDT,
-            OptimizationRemarkEmitter &ORE, const DataLayout &DL,
-            AssumptionCache &AC, const TargetTransformInfo &TTI)
+            OptimizationRemarkEmitter &ORE, AssumptionCache &AC,
+            const TargetTransformInfo &TTI)
       : LDT(LI), DTU(DT, PDT, DomTreeUpdater::UpdateStrategy::Lazy), LI(LI),
         DT(DT), DI(DI), SE(SE), PDT(PDT), ORE(ORE), AC(AC), TTI(TTI) {}
 
@@ -1895,7 +1895,6 @@ PreservedAnalyses LoopFusePass::run(Function &F, FunctionAnalysisManager &AM) {
   auto &ORE = AM.getResult<OptimizationRemarkEmitterAnalysis>(F);
   auto &AC = AM.getResult<AssumptionAnalysis>(F);
   const TargetTransformInfo &TTI = AM.getResult<TargetIRAnalysis>(F);
-  const DataLayout &DL = F.getDataLayout();
 
   // Ensure loops are in simplifed form which is a pre-requisite for loop fusion
   // pass. Added only for new PM since the legacy PM has already added
@@ -1908,7 +1907,7 @@ PreservedAnalyses LoopFusePass::run(Function &F, FunctionAnalysisManager &AM) {
   if (Changed)
     PDT.recalculate(F);
 
-  LoopFuser LF(LI, DT, DI, SE, PDT, ORE, DL, AC, TTI);
+  LoopFuser LF(LI, DT, DI, SE, PDT, ORE, AC, TTI);
   Changed |= LF.fuseLoops(F);
   if (!Changed)
     return PreservedAnalyses::all();



More information about the llvm-commits mailing list