<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/111757>111757</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir] remove-dead-values zero exit code on failure
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mtopalovicTT
</td>
</tr>
</table>
<pre>
In case remove-dead-values pass emits error like below:
`/localdev/mtopalovic/src/tt-mlir/test/ttmlir/Dialect/TTNN/simple_broadcast.mlir:3:1: error: cannot optimize an IR with non-function symbol ops, non-call symbol user ops or branch ops`
mlir opt pass doesn't return `failure` but `success`.
This was discovered when llvm-lit reported that a test which emitted error above succeeded, but when command llvm-lit run was run manually you could see error above. This is because llvm-lit checks for error code in order to determine if test failed or succeeded.
Are we missing `signalPassFailure` in `removeDeadValuePass`
https://github.com/llvm/llvm-project/blob/10054ba4acbc5378d2e2aa869a5bccd88aa4b59e/mlir/lib/Transforms/RemoveDeadValues.cpp#L584
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVM2u4ygTfRq8KcXyv-OFF_m-KFJLo9aoFc12VEAlZhqDRWFnbj_9COfevmlpNrMBG6hTp04dQGZzd0SjaP8n2nOGa5x8GOfoF7R-M-p6zaTXb-MXBwqZINDsNzpoQn3Y0K7EsCAz0GwiA4XgA1jznUCS9Q9Rn0RxFsXH2BWiuliv0GraRHX5zCOqC4c0xniYrQnpizjuC-__Z4OWVFq6Xr9-TQFmXiz9KYNHrZBjvh-sT7WoT6WoT0866UOhcz6CX6KZzQ8CdPDlGzxMnMB5d7itTkXjHfDbLL0Fv7Co_r9vKbT2Y3llCmkPfAAZ0KlpP9kVrzUmDinRUxbtiZ2o-giB4hociK64obFrINEVINeYVnhVijgh5a9Q18kwPJBBG1Z-o0AaHhM5sHabD9Yk0MWHSBrihBEQkmTwmIya9oaknWdLUPqNYM9DmnSqLuXe0ZSfZ3T6BXV1e9o0z-hWtPYN3vwKyq9WAxO9ouaw8zQMkhSuTJ9AaiL1neHmw3uA8prAOPBBU4DoQVOkMBtHYG5P9kkd0knin2xzeFXlFAgeBLNhNu6-y2fuDu3vyHz5lNbsWj_teibUfySzpjM_-zXFuHByaHUR1eVu4rTKXPk5WdRuH9NhCf6vp-2k9VJUl7Io2kZig0qqtu6PuqIK8dgN2Eql9PGI2Mh2oOTvp3OtSXHXgI5vPswsqsu3X4lxrpZFVPVv7bH55cbsY6bHWg_1gBmNZV8d26JtjkM2jU3TaI0D4lD0Rd8fy-5WopLD0OuhuRWUmbEqqqYsiiHNzZCX2KC-kerapuvaEkVT0IzG5qnW3Id7ZphXGsuy7Ns-syjJ8sfrEMZdEbneWTSFNRz5My6aaPd3ZC-6Pf_bU_GDggf6O1kjOcE7eL8M2Rrs-J8bslNNar6z3cbqnwAAAP__3K6ZxQ">