llvm-project
llvm-project copied to clipboard
[MLIR] `remove-dead-values` misses a dead block argument
In the following example, --remove-dead-values should remove the block argument %0 on line 4 because it is never used. However, the pass fails to remove it, resulting in a missed optimization opportunity.
Input Program
input.mlir
module {
func.func @func_t8(%arg0: i32) -> i32 {
cf.br ^bb1(%arg0 : i32)
^bb1(%0: i32): // pred: ^bb0
return %arg0 : i32
}
}
Command
mlir-opt --remove-dead-values input.mlir
Version: ef88536bbf62469eb2396d719d237b3191cf4843
@llvm/issue-subscribers-mlir
Author: CC_Fans (dev-816)
In the following example, `--remove-dead-values` should remove the block argument `%0` on line 4 because it is never used. However, the pass fails to remove it, resulting in a missed optimization opportunity.
Input Program
input.mlir
module {
func.func @<!-- -->func_t8(%arg0: i32) -> i32 {
cf.br ^bb1(%arg0 : i32)
^bb1(%0: i32): // pred: ^bb0
return %arg0 : i32
}
}
Command
mlir-opt --remove-dead-values input.mlir
Version: ef88536bbf62469eb2396d719d237b3191cf4843
Hi, I've started working on this issue. Could you please assign this issue to me?