[llvm] e7d3f43 - [LoopFlatten] Inline an external linkage function not in llvm::. NFC
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 15:40:39 PST 2023
Author: Fangrui Song
Date: 2023-02-15T15:40:34-08:00
New Revision: e7d3f43eafdd01e50402754ac9c5e6ae9d5118e1
URL: https://github.com/llvm/llvm-project/commit/e7d3f43eafdd01e50402754ac9c5e6ae9d5118e1
DIFF: https://github.com/llvm/llvm-project/commit/e7d3f43eafdd01e50402754ac9c5e6ae9d5118e1.diff
LOG: [LoopFlatten] Inline an external linkage function not in llvm::. NFC
Added:
Modified:
llvm/lib/Transforms/Scalar/LoopFlatten.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
index 9fc69f528617..7d23421f6945 100644
--- a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
@@ -918,20 +918,6 @@ static bool FlattenLoopPair(FlattenInfo &FI, DominatorTree *DT, LoopInfo *LI,
return DoFlattenLoopPair(FI, DT, LI, SE, AC, TTI, U, MSSAU);
}
-bool Flatten(LoopNest &LN, DominatorTree *DT, LoopInfo *LI, ScalarEvolution *SE,
- AssumptionCache *AC, TargetTransformInfo *TTI, LPMUpdater *U,
- MemorySSAUpdater *MSSAU) {
- bool Changed = false;
- for (Loop *InnerLoop : LN.getLoops()) {
- auto *OuterLoop = InnerLoop->getParentLoop();
- if (!OuterLoop)
- continue;
- FlattenInfo FI(OuterLoop, InnerLoop);
- Changed |= FlattenLoopPair(FI, DT, LI, SE, AC, TTI, U, MSSAU);
- }
- return Changed;
-}
-
PreservedAnalyses LoopFlattenPass::run(LoopNest &LN, LoopAnalysisManager &LAM,
LoopStandardAnalysisResults &AR,
LPMUpdater &U) {
@@ -949,8 +935,14 @@ PreservedAnalyses LoopFlattenPass::run(LoopNest &LN, LoopAnalysisManager &LAM,
// in simplified form, and also needs LCSSA. Running
// this pass will simplify all loops that contain inner loops,
// regardless of whether anything ends up being flattened.
- Changed |= Flatten(LN, &AR.DT, &AR.LI, &AR.SE, &AR.AC, &AR.TTI, &U,
- MSSAU ? &*MSSAU : nullptr);
+ for (Loop *InnerLoop : LN.getLoops()) {
+ auto *OuterLoop = InnerLoop->getParentLoop();
+ if (!OuterLoop)
+ continue;
+ FlattenInfo FI(OuterLoop, InnerLoop);
+ Changed |= FlattenLoopPair(FI, &AR.DT, &AR.LI, &AR.SE, &AR.AC, &AR.TTI, &U,
+ MSSAU ? &*MSSAU : nullptr);
+ }
if (!Changed)
return PreservedAnalyses::all();
More information about the llvm-commits
mailing list