[Mlir-commits] [mlir] [mlir][Transforms] Fix crash in `-remove-dead-values` on private functions (PR #169269)
lonely eagle
llvmlistbot at llvm.org
Wed Nov 26 04:18:57 PST 2025
linuxlonelyeagle wrote:
Thank you for inviting me to participate in the discussion.
> * `` marks all operands of side-effecting ops as "live" [1]. The only exception are ops that are not reachable [2].
> @ftynse @joker-eph @linuxlonelyeagle What are the next steps here? Are you convinced that this fix is correct? If not, can you think of a case where this fix is incorrect?
>
> **Summary:**
>
> * When you remove an SSA value, you must also remove all uses of that SSA value. Otherwise, you produce invalid IR. (That's the bug that I'm fixing in this PR.)
https://github.com/llvm/llvm-project/issues/158760, The problem you are solving should be similar to this one.
> * (Private functions are dead unless they are called from a public function.)
I have always suggested deleting useless private functions directly and introducing this feature in remove-dead-values.
This function hasn't been called yet, has it?Since we can delete useless values, why can't we delete functions(use -symbol-dce)?
This idea may not be very conservative(I admit that this idea is very radical.).Let's first remove the useless functions, they will work very well.
https://github.com/llvm/llvm-project/pull/169269
More information about the Mlir-commits
mailing list