[Mlir-commits] [mlir] [mlir][Transforms] --remove-dead-values: keep values used in public function calls (PR #83249)
Artem Tyurin
llvmlistbot at llvm.org
Wed Feb 28 12:11:10 PST 2024
================
@@ -169,7 +169,10 @@ static SmallVector<OpOperand *> operandsToOpOperands(OperandRange operands) {
/// Here, cleaning means:
/// (1) Dropping all its uses, AND
/// (2) Erasing it
-/// iff it has no memory effects and none of its results are live.
+/// iff:
+/// (1) It has no memory effects
+/// (2) None of its results are live
+/// (3) It is not used as an argument in a public function call
----------------
agentcooper wrote:
I've posted a detailed analysis here: https://github.com/llvm/llvm-project/issues/82788#issuecomment-1966743137. Please also see a test case. The short answer is that if the function is public, its unused parameters will not be removed, but the argument is erased, resulting in a validation error.
https://github.com/llvm/llvm-project/pull/83249
More information about the Mlir-commits
mailing list