syang-ng opened a new issue #9407:
URL: https://github.com/apache/tvm/issues/9407
It seems that if we use the same variable `v` in both let statement and
select expression like this, it will trigger crash:
```
primfn(v: int32) -> () {
let v = select(cast(bool, v), 150, 1)
v
}
```
### Expected behavior
Throw exception or just build successfully.
### Actual behavior
The program crashes. And I use gdb to trace this bug, it seems that `op` is
nullptr in `arith/ir_mutator_with_analyzer.cc`.


### Environment
Ubuntu18.04, cmake 3.18.2, llvm 12, tested on latest git
[4087e72](https://github.com/apache/tvm/commit/4087e72b657eae484bb647cbd8ef86b9acf11748)
### Steps to reproduce
Here is the
```python
import tvm
from tvm import tir
v = tir.Var('v', 'int32')
s = tir.Select(tir.Cast('bool',v), 150, 1)
let_stmt = tir.LetStmt(v, s, tir.Evaluate(v))
f = tir.PrimFunc({v},let_stmt)
tvm.build(f)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]