[llvm] 7a37d98 - [llvm] Use pop_back_val (NFC)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 20:55:25 PST 2021


Author: Kazu Hirata
Date: 2021-02-01T20:55:05-08:00
New Revision: 7a37d981d90529a125b425b1ca155da530c3008a

URL: https://github.com/llvm/llvm-project/commit/7a37d981d90529a125b425b1ca155da530c3008a
DIFF: https://github.com/llvm/llvm-project/commit/7a37d981d90529a125b425b1ca155da530c3008a.diff

LOG: [llvm] Use pop_back_val (NFC)

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/SparsePropagation.h
    llvm/lib/Analysis/BranchProbabilityInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/SparsePropagation.h b/llvm/include/llvm/Analysis/SparsePropagation.h
index 81a2533152de..27c58c0afa8a 100644
--- a/llvm/include/llvm/Analysis/SparsePropagation.h
+++ b/llvm/include/llvm/Analysis/SparsePropagation.h
@@ -470,8 +470,7 @@ void SparseSolver<LatticeKey, LatticeVal, KeyInfo>::Solve() {
   while (!BBWorkList.empty() || !ValueWorkList.empty()) {
     // Process the value work list.
     while (!ValueWorkList.empty()) {
-      Value *V = ValueWorkList.back();
-      ValueWorkList.pop_back();
+      Value *V = ValueWorkList.pop_back_val();
 
       LLVM_DEBUG(dbgs() << "\nPopped off V-WL: " << *V << "\n");
 

diff  --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
index 884ba484ae19..4cb17b81b467 100644
--- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp
+++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -550,8 +550,7 @@ computeUnlikelySuccessors(const BasicBlock *BB, Loop *L,
   WorkList.push_back(CmpPHI);
   VisitedInsts.insert(CmpPHI);
   while (!WorkList.empty()) {
-    PHINode *P = WorkList.back();
-    WorkList.pop_back();
+    PHINode *P = WorkList.pop_back_val();
     for (BasicBlock *B : P->blocks()) {
       // Skip blocks that aren't part of the loop
       if (!L->contains(B))


        


More information about the llvm-commits mailing list