From cfc2b0d094f705aa0995eff0dc5f1faf1440a769 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 21 Apr 2025 08:13:16 -0700 Subject: [PATCH] [llvm] Use llvm::SmallVector::pop_back_val (NFC) (#136533) --- llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp | 3 +-- llvm/lib/CodeGen/SplitKit.cpp | 3 +-- llvm/lib/Support/SuffixTree.cpp | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp b/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp index a04b6e4c061a..790edf12b46b 100644 --- a/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp +++ b/llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp @@ -1151,8 +1151,7 @@ ComplexDeinterleavingGraph::identifyReassocNodes(Instruction *Real, SmallVector> Worklist = {{Insn, true}}; SmallPtrSet Visited; while (!Worklist.empty()) { - auto [V, IsPositive] = Worklist.back(); - Worklist.pop_back(); + auto [V, IsPositive] = Worklist.pop_back_val(); if (!Visited.insert(V).second) continue; diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp index e55dfaebd028..f118ee521925 100644 --- a/llvm/lib/CodeGen/SplitKit.cpp +++ b/llvm/lib/CodeGen/SplitKit.cpp @@ -1519,8 +1519,7 @@ void SplitEditor::forceRecomputeVNI(const VNInfo &ParentVNI) { const LiveInterval &ParentLI = Edit->getParent(); const SlotIndexes &Indexes = *LIS.getSlotIndexes(); do { - const VNInfo &VNI = *WorkList.back(); - WorkList.pop_back(); + const VNInfo &VNI = *WorkList.pop_back_val(); for (unsigned I = 0, E = Edit->size(); I != E; ++I) forceRecompute(I, VNI); if (!VNI.isPHIDef()) diff --git a/llvm/lib/Support/SuffixTree.cpp b/llvm/lib/Support/SuffixTree.cpp index daf66108657b..a31287836e86 100644 --- a/llvm/lib/Support/SuffixTree.cpp +++ b/llvm/lib/Support/SuffixTree.cpp @@ -95,8 +95,7 @@ void SuffixTree::setSuffixIndices() { unsigned CurrNodeLen = 0; ToVisit.push_back({CurrNode, CurrNodeLen}); while (!ToVisit.empty()) { - std::tie(CurrNode, CurrNodeLen) = ToVisit.back(); - ToVisit.pop_back(); + std::tie(CurrNode, CurrNodeLen) = ToVisit.pop_back_val(); // Length of the current node from the root down to here. CurrNode->setConcatLen(CurrNodeLen); if (auto *InternalNode = dyn_cast(CurrNode))