Hello LLVM Community,
I’m currently exploring the RemoveDeadValuesPass
implemented in RemoveDeadValues.cpp
within MLIR and have some questions regarding the criteria used for determining an acceptable IR for dead values removal.
The main function, runOnOperation()
, employs a specific check for acceptable IR before it proceeds to remove dead values. This involves ensuring the IR does not contain operations that are classified under the branch op interface, symbol op interface, or symbol user op interface, among others.
However, I’ve observed a scenario that prompts a deeper inquiry: if a moduleOp
contains a memref.global private constant op
, such as a Memref initialized with four integer values (i.e memref.global "private" constant @__constant_4xi32 : memref<4xi32> = dense<[0, 16, 32, 48]> {alignment = 16 : i64}
, it seems to categorize the IR as unacceptable for this pass. This specific inclusion of memref.global private constant op
piqued my interest, and I would appreciate an explanation on why such a global operation disqualifies the IR from dead values removal.
CC: @SrishtiSrivastava @Wheest
Thank you for your insights!
Zeeshan Siddiqui