diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-11-19 20:06:13 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-11-19 20:06:13 +0000 |
commit | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (patch) | |
tree | f42add1021b9f2ac6a69ac7cf6c4499962739a45 /llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp | |
parent | 344a3780b2e33f6ca763666c380202b18aab72a3 (diff) | |
download | src-c0981da47d5696fe36474fcf86b4ce03ae3ff818.tar.gz src-c0981da47d5696fe36474fcf86b4ce03ae3ff818.zip |
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp b/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp index d36ffc3da641..9a3feb5b6af1 100644 --- a/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp +++ b/llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp @@ -364,7 +364,7 @@ bool HexagonEarlyIfConversion::isValidCandidate(const MachineBasicBlock *B) return true; if (B->isEHPad() || B->hasAddressTaken()) return false; - if (B->succ_size() == 0) + if (B->succ_empty()) return false; for (auto &MI : *B) { @@ -390,8 +390,8 @@ bool HexagonEarlyIfConversion::isValidCandidate(const MachineBasicBlock *B) continue; if (!isPredicate(R)) continue; - for (auto U = MRI->use_begin(R); U != MRI->use_end(); ++U) - if (U->getParent()->isPHI()) + for (const MachineOperand &U : MRI->use_operands(R)) + if (U.getParent()->isPHI()) return false; } } @@ -570,12 +570,12 @@ bool HexagonEarlyIfConversion::isProfitable(const FlowPattern &FP) const { TotalPh = computePhiCost(FP.JoinB, FP); PredDefs += countPredicateDefs(FP.JoinB); } else { - if (FP.TrueB && FP.TrueB->succ_size() > 0) { + if (FP.TrueB && !FP.TrueB->succ_empty()) { MachineBasicBlock *SB = *FP.TrueB->succ_begin(); TotalPh += computePhiCost(SB, FP); PredDefs += countPredicateDefs(SB); } - if (FP.FalseB && FP.FalseB->succ_size() > 0) { + if (FP.FalseB && !FP.FalseB->succ_empty()) { MachineBasicBlock *SB = *FP.FalseB->succ_begin(); TotalPh += computePhiCost(SB, FP); PredDefs += countPredicateDefs(SB); @@ -877,7 +877,7 @@ void HexagonEarlyIfConversion::convert(const FlowPattern &FP) { // existing terminators/successors from the split block. MachineBasicBlock *SSB = nullptr; FP.SplitB->erase(OldTI, FP.SplitB->end()); - while (FP.SplitB->succ_size() > 0) { + while (!FP.SplitB->succ_empty()) { MachineBasicBlock *T = *FP.SplitB->succ_begin(); // It's possible that the split block had a successor that is not a pre- // dicated block. This could only happen if there was only one block to @@ -970,7 +970,7 @@ void HexagonEarlyIfConversion::removeBlock(MachineBasicBlock *B) { } } - while (B->succ_size() > 0) + while (!B->succ_empty()) B->removeSuccessor(B->succ_begin()); for (auto I = B->pred_begin(), E = B->pred_end(); I != E; ++I) |