[llvm] 9db0e21 - [llvm] Use depth_first (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 21 22:29:05 PST 2021
Author: Kazu Hirata
Date: 2021-12-21T22:28:48-08:00
New Revision: 9db0e21660b5cdaebd98aea79cccfe40f1a1ee98
URL: https://github.com/llvm/llvm-project/commit/9db0e21660b5cdaebd98aea79cccfe40f1a1ee98
DIFF: https://github.com/llvm/llvm-project/commit/9db0e21660b5cdaebd98aea79cccfe40f1a1ee98.diff
LOG: [llvm] Use depth_first (NFC)
Added:
Modified:
llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp
llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp
llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp b/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp
index 209f9f7255a57..793663ef97d7e 100644
--- a/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp
@@ -138,8 +138,8 @@ bool FalkorMarkStridedAccesses::run() {
bool MadeChange = false;
for (Loop *L : LI)
- for (auto LIt = df_begin(L), LE = df_end(L); LIt != LE; ++LIt)
- MadeChange |= runOnLoop(**LIt);
+ for (Loop *LIt : depth_first(L))
+ MadeChange |= runOnLoop(*LIt);
return MadeChange;
}
@@ -828,10 +828,10 @@ bool FalkorHWPFFix::runOnMachineFunction(MachineFunction &Fn) {
Modified = false;
for (MachineLoop *I : LI)
- for (auto L = df_begin(I), LE = df_end(I); L != LE; ++L)
+ for (MachineLoop *L : depth_first(I))
// Only process inner-loops
if (L->isInnermost())
- runOnLoop(**L, Fn);
+ runOnLoop(*L, Fn);
return Modified;
}
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp b/llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp
index 2a2338ac70168..2475b44b42a3d 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp
@@ -428,7 +428,7 @@ class CollectReachableCallees {
//
// FIXME: Need to handle bit-casted function pointers.
//
- SmallVector<CallGraphNode *, 8> CGNStack(df_begin(KCGN), df_end(KCGN));
+ SmallVector<CallGraphNode *, 8> CGNStack(depth_first(KCGN));
SmallPtrSet<CallGraphNode *, 8> VisitedCGNodes;
while (!CGNStack.empty()) {
auto *CGN = CGNStack.pop_back_val();
diff --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
index 7f63827afbd66..0c7be96a0595e 100644
--- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
+++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
@@ -413,9 +413,9 @@ bool PPCLoopInstrFormPrep::runOnFunction(Function &F) {
bool MadeChange = false;
- for (auto I = LI->begin(), IE = LI->end(); I != IE; ++I)
- for (auto L = df_begin(*I), LE = df_end(*I); L != LE; ++L)
- MadeChange |= runOnLoop(*L);
+ for (Loop *I : *LI)
+ for (Loop *L : depth_first(I))
+ MadeChange |= runOnLoop(L);
return MadeChange;
}
diff --git a/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp b/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
index 77d76609c926f..57e36e5b9b900 100644
--- a/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
@@ -224,8 +224,8 @@ bool LoopDataPrefetch::run() {
bool MadeChange = false;
for (Loop *I : *LI)
- for (auto L = df_begin(I), LE = df_end(I); L != LE; ++L)
- MadeChange |= runOnLoop(*L);
+ for (Loop *L : depth_first(I))
+ MadeChange |= runOnLoop(L);
return MadeChange;
}
More information about the llvm-commits
mailing list