[Mlir-commits] [mlir] 7c2bbfa - [mlir][Transforms][NFC] `remove-dead-values`: Split `OperationToCleanup` (#173542)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Dec 26 03:44:27 PST 2025


Author: Matthias Springer
Date: 2025-12-26T12:44:23+01:00
New Revision: 7c2bbfae3e16fa822494c5bff3aa8dae933d4f1e

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

LOG: [mlir][Transforms][NFC] `remove-dead-values`: Split `OperationToCleanup` (#173542)

The `callee` field does not make sense for op results. Split
`OperationToCleanup` into `OperandsToCleanup` and `ResultsToCleanup`.

Added: 
    

Modified: 
    mlir/lib/Transforms/RemoveDeadValues.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Transforms/RemoveDeadValues.cpp b/mlir/lib/Transforms/RemoveDeadValues.cpp
index a79f1fd93cb9c..878624abee464 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 =
@@ -108,8 +113,8 @@ struct RDVFinalCleanupList {
   SmallVector<Operation *> operations;
   SmallVector<Value> values;
   SmallVector<FunctionToCleanUp> functions;
-  SmallVector<OperationToCleanup> operands;
-  SmallVector<OperationToCleanup> results;
+  SmallVector<OperandsToCleanup> operands;
+  SmallVector<ResultsToCleanup> results;
   SmallVector<BlockArgsToCleanup> blocks;
   SmallVector<SuccessorOperandsToCleanup> successorOperands;
 };
@@ -882,7 +887,7 @@ static void cleanUpDeadVals(RDVFinalCleanupList &list) {
 
   // 6. 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.


        


More information about the Mlir-commits mailing list