Skip to content

Commit 0314755

Browse files
[llvm] Use llvm::SmallVector::pop_back_val (NFC) (#136441)
1 parent 0c4309b commit 0314755

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,8 +1793,7 @@ bool ComplexDeinterleavingGraph::checkNodes() {
17931793
// Extract all instructions that are used by all XCMLA/XCADD/ADD/SUB/NEG
17941794
// chains
17951795
while (!Worklist.empty()) {
1796-
auto *I = Worklist.back();
1797-
Worklist.pop_back();
1796+
auto *I = Worklist.pop_back_val();
17981797

17991798
if (!AllInstructions.insert(I).second)
18001799
continue;
@@ -1828,8 +1827,7 @@ bool ComplexDeinterleavingGraph::checkNodes() {
18281827
// that somehow connect to those instructions.
18291828
SmallPtrSet<Instruction *, 16> Visited;
18301829
while (!Worklist.empty()) {
1831-
auto *I = Worklist.back();
1832-
Worklist.pop_back();
1830+
auto *I = Worklist.pop_back_val();
18331831
if (!Visited.insert(I).second)
18341832
continue;
18351833

llvm/lib/CodeGen/TwoAddressInstructionPass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,7 @@ void TwoAddressInstructionImpl::scanUses(Register DstReg) {
854854
}
855855

856856
if (!VirtRegPairs.empty()) {
857-
Register ToReg = VirtRegPairs.back();
858-
VirtRegPairs.pop_back();
857+
Register ToReg = VirtRegPairs.pop_back_val();
859858
while (!VirtRegPairs.empty()) {
860859
Register FromReg = VirtRegPairs.pop_back_val();
861860
bool isNew = DstRegMap.insert(std::make_pair(FromReg, ToReg)).second;

llvm/lib/Support/SuffixTree.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,7 @@ void SuffixTree::RepeatedSubstringIterator::advance() {
306306
// Continue visiting nodes until we find one which repeats more than once.
307307
while (!InternalNodesToVisit.empty()) {
308308
RepeatedSubstringStarts.clear();
309-
auto *Curr = InternalNodesToVisit.back();
310-
InternalNodesToVisit.pop_back();
309+
auto *Curr = InternalNodesToVisit.pop_back_val();
311310

312311
// Keep track of the length of the string associated with the node. If
313312
// it's too short, we'll quit.

llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,8 +1528,7 @@ bool MemCpyOptPass::performStackMoveOptzn(Instruction *Load, Instruction *Store,
15281528
Worklist.reserve(MaxUsesToExplore);
15291529
SmallSet<const Use *, 20> Visited;
15301530
while (!Worklist.empty()) {
1531-
Instruction *I = Worklist.back();
1532-
Worklist.pop_back();
1531+
Instruction *I = Worklist.pop_back_val();
15331532
for (const Use &U : I->uses()) {
15341533
auto *UI = cast<Instruction>(U.getUser());
15351534
// If any use that isn't dominated by SrcAlloca exists, we move src

llvm/lib/Transforms/Utils/CodeMoverUtils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,7 @@ bool llvm::nonStrictlyPostDominate(const BasicBlock *ThisBlock,
464464
SmallPtrSet<const BasicBlock *, 8> Visited;
465465
WorkList.push_back(ThisBlock);
466466
while (!WorkList.empty()) {
467-
const BasicBlock *CurBlock = WorkList.back();
468-
WorkList.pop_back();
467+
const BasicBlock *CurBlock = WorkList.pop_back_val();
469468
Visited.insert(CurBlock);
470469
if (PDT->dominates(CurBlock, OtherBlock))
471470
return true;

0 commit comments

Comments
 (0)