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`.
   
   
![image](https://user-images.githubusercontent.com/25731241/139637905-9c3392d6-f113-4aae-aaef-2ce7e43342f6.png)
   
   
![image](https://user-images.githubusercontent.com/25731241/139637773-0b13d48e-df21-40a3-aa8e-e3d977b6d7bd.png)
   
   
   ### 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]


Reply via email to