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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Apr 19 12:39:18 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/136452.diff


2 Files Affected:

- (modified) mlir/lib/Analysis/Liveness.cpp (+1-2) 
- (modified) mlir/lib/Rewrite/ByteCode.cpp (+1-2) 


``````````diff
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.

``````````

</details>


https://github.com/llvm/llvm-project/pull/136452


More information about the Mlir-commits mailing list