<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/82788>82788</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`remove-dead-values` pass gives `null` operand error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pingshiyu
</td>
</tr>
</table>
<pre>
I was compiling the below program using:
`mlir-opt --remove-dead-values out.mlir`
`"builtin.module"() ({
^bb0():
"func.func"() ({
^bb0(%1 : i1, %2 : i1):
%3 = "arith.constant"() {value=1 : i1} : () -> (i1)
"func.return"(%2, %3) : (i1, i1) -> ()
}) {sym_name="func0", function_type=(i1, i1) -> (i1, i1)} : () -> ()
"func.func"() ({
^bb0(%4 : i1):
%5 = "arith.constant"() {value=true} : () -> (i1)
%7, %8 = "func.call"(%5, %4) {callee=@func0} : (i1, i1) -> (i1, i1)
"func.return"(%7, %8) : (i1, i1) -> ()
}) {sym_name="func1", function_type=(i1) -> (i1, i1)} : () -> ()
}) : () -> ()`
However, I get the following error:
`<source>:11:26: error: null operand found
%7, %8 = "func.call"(%5, %4) {callee=@func0} : (i1, i1) -> (i1, i1)
^
<source>:11:26: note: see current operation: %0:2 = "func.call"(<<NULL VALUE>>, %arg0) <{callee = @func0}> : (<<NULL TYPE>>, i1) -> (i1, i1)
Compiler returned: 1`
I do not understand the error message, as the variables used in the function call do not look `null` at all to me. The above is the reduced test case. The Pass documentation didn't yield anything useful regarding this error, unfortunately.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVU2P2zYQ_TX0ZWCDJvVhHXTw2l50gUWRQ1Kgp4ASxzJbijT44YX_fUFJ_tjsbtIUPUQHS9YM35s38ygK71VnEGuSP5B8OxMxHKyrj8p0_qDOcdZYea6f4EV4aG1_VFqZDsIBoUFtX-DobOdED9Er0xG-JnRL6JoUtNfKze0xwHzusLcnnEsUcn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