[llvm-branch-commits] [mlir] [mlir][Transforms][NFC] `remove-dead-values`: Split `OperationToCleanup` (PR #173542)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Dec 25 03:04:37 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Matthias Springer (matthias-springer)
<details>
<summary>Changes</summary>
The `callee` field does not make sense for op results. Split `OperationToCleanup` into `OperandsToCleanup` and `ResultsToCleanup`.
---
Full diff: https://github.com/llvm/llvm-project/pull/173542.diff
1 Files Affected:
- (modified) mlir/lib/Transforms/RemoveDeadValues.cpp (+9-4)
``````````diff
diff --git a/mlir/lib/Transforms/RemoveDeadValues.cpp b/mlir/lib/Transforms/RemoveDeadValues.cpp
index 6c1f7ddc80184..62ce5e0bbb77e 100644
--- a/mlir/lib/Transforms/RemoveDeadValues.cpp
+++ b/mlir/lib/Transforms/RemoveDeadValues.cpp
@@ -86,7 +86,12 @@ struct FunctionToCleanUp {
BitVector nonLiveRets;
};
-struct OperationToCleanup {
+struct ResultsToCleanup {
+ Operation *op;
+ BitVector nonLive;
+};
+
+struct OperandsToCleanup {
Operation *op;
BitVector nonLive;
Operation *callee =
@@ -107,8 +112,8 @@ struct SuccessorOperandsToCleanup {
struct RDVFinalCleanupList {
SmallVector<Operation *> operations;
SmallVector<FunctionToCleanUp> functions;
- SmallVector<OperationToCleanup> operands;
- SmallVector<OperationToCleanup> results;
+ SmallVector<OperandsToCleanup> operands;
+ SmallVector<ResultsToCleanup> results;
SmallVector<BlockArgsToCleanup> blocks;
SmallVector<SuccessorOperandsToCleanup> successorOperands;
};
@@ -875,7 +880,7 @@ static void cleanUpDeadVals(RDVFinalCleanupList &list) {
// 5. Operands
LDBG() << "Cleaning up " << list.operands.size() << " operand lists";
- for (OperationToCleanup &o : list.operands) {
+ for (OperandsToCleanup &o : list.operands) {
// Handle call-specific cleanup only when we have a cached callee reference.
// This avoids expensive symbol lookup and is defensive against future
// changes.
``````````
</details>
https://github.com/llvm/llvm-project/pull/173542
More information about the llvm-branch-commits
mailing list