[Mlir-commits] [mlir] 1cf188a - [mlir] Use llvm::SmallVector::pop_back_val() (NFC) (#136452)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Apr 19 13:21:33 PDT 2025


Author: Kazu Hirata
Date: 2025-04-19T13:21:29-07:00
New Revision: 1cf188a1bca6d1ce135eab4cce5dead4f8f55026

URL: https://github.com/llvm/llvm-project/commit/1cf188a1bca6d1ce135eab4cce5dead4f8f55026
DIFF: https://github.com/llvm/llvm-project/commit/1cf188a1bca6d1ce135eab4cce5dead4f8f55026.diff

LOG: [mlir] Use llvm::SmallVector::pop_back_val() (NFC) (#136452)

Added: 
    

Modified: 
    mlir/lib/Analysis/Liveness.cpp
    mlir/lib/Rewrite/ByteCode.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/Liveness.cpp b/mlir/lib/Analysis/Liveness.cpp
index 3e39d974c0e21..3fcc0b5a6ffef 100644
--- a/mlir/lib/Analysis/Liveness.cpp
+++ b/mlir/lib/Analysis/Liveness.cpp
@@ -198,8 +198,7 @@ Liveness::OperationListT Liveness::resolveLiveness(Value value) const {
 
   while (!toProcess.empty()) {
     // Get block and block liveness information.
-    Block *block = toProcess.back();
-    toProcess.pop_back();
+    Block *block = toProcess.pop_back_val();
     const LivenessBlockInfo *blockInfo = getLiveness(block);
 
     // Note that start and end will be in the same block.

diff  --git a/mlir/lib/Rewrite/ByteCode.cpp b/mlir/lib/Rewrite/ByteCode.cpp
index 26510f976efc9..17cb3a74184f1 100644
--- a/mlir/lib/Rewrite/ByteCode.cpp
+++ b/mlir/lib/Rewrite/ByteCode.cpp
@@ -1198,8 +1198,7 @@ class ByteCodeExecutor {
   /// Pops a code iterator from the stack, returning true on success.
   void popCodeIt() {
     assert(!resumeCodeIt.empty() && "attempt to pop code off empty stack");
-    curCodeIt = resumeCodeIt.back();
-    resumeCodeIt.pop_back();
+    curCodeIt = resumeCodeIt.pop_back_val();
   }
 
   /// Return the bytecode iterator at the start of the current op code.


        


More information about the Mlir-commits mailing list