[llvm] 8fddf7f - [llvm] Use MachineBasicBlock::succ_empty (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 22 00:13:37 PST 2024
Author: Kazu Hirata
Date: 2024-01-22T00:13:25-08:00
New Revision: 8fddf7fd148cbb9e5c09e351cd1be410a513702a
URL: https://github.com/llvm/llvm-project/commit/8fddf7fd148cbb9e5c09e351cd1be410a513702a
DIFF: https://github.com/llvm/llvm-project/commit/8fddf7fd148cbb9e5c09e351cd1be410a513702a.diff
LOG: [llvm] Use MachineBasicBlock::succ_empty (NFC)
Added:
Modified:
llvm/lib/CodeGen/UnreachableBlockElim.cpp
llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/UnreachableBlockElim.cpp b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
index f17450d264ba07..1a60e9abbe2e26 100644
--- a/llvm/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
@@ -117,7 +117,7 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) {
if (MLI) MLI->removeBlock(&BB);
if (MDT && MDT->getNode(&BB)) MDT->eraseNode(&BB);
- while (BB.succ_begin() != BB.succ_end()) {
+ while (!BB.succ_empty()) {
MachineBasicBlock* succ = *BB.succ_begin();
for (MachineInstr &Phi : succ->phis()) {
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
index d90fcac875408e..289c35e11bebfa 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp
@@ -1721,7 +1721,7 @@ void AMDGPUMachineCFGStructurizer::insertMergePHI(MachineBasicBlock *IfBB,
unsigned CodeSourceRegister,
bool IsUndefIfSource) {
// If this is the function exit block, we don't need a phi.
- if (MergeBB->succ_begin() == MergeBB->succ_end()) {
+ if (MergeBB->succ_empty()) {
return;
}
LLVM_DEBUG(dbgs() << "Merge PHI (" << printMBBReference(*MergeBB)
More information about the llvm-commits
mailing list