[Mlir-commits] [mlir] [mlir][RemoveDeadValues] Replace dead function argument uses with poison (PR #208881)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sat Jul 18 03:46:50 PDT 2026
jjppp wrote:
Ping. @joker-eph @jpienaar , could you please take a look when you have a chance?
This is a follow-up to #153973 and the discussion in #206920.
In an unreachable private function, liveness analysis marks the function arguments as dead, while some side-effecting operations may still survive the cleanup.
Calling `dropAllUses()` on such an argument leaves null operands in those surviving operations, and the final canonicalization then crashes while folding invalid IR.
This patch replaces the remaining uses with `ub.poison` before erasing the argument. This follows the existing invariant in RemoveDeadValues, where live uses of erased operation results are also replaced with poison to keep the IR valid.
I would especially appreciate feedback on whether using poison here is the intended solution, as opposed to skipping dead-value cleanup inside unreachable functions ;-)
https://github.com/llvm/llvm-project/pull/208881
More information about the Mlir-commits
mailing list