Hello, recently I found a question that TVM was trapped in a dead cycle if I used the bool IntImm condition and a loop with a specific beginning value and length. I;m curious about the reason why TVM is trapped in a dead cycle. In the following example, f1 and f2 will triger the dead cycle while f3 runs normally. TVM version is 0.9.dev0, the git commit is 8f6543e9e6173cd45b678e91b5a637ff7f8e0e02.
Iād be appreciated if anyone can help me.
import tvm
from tvm import tir
v1=tir.Var('v1','uint32')
c1=tir.const(1674181026,'uint32')
c2=tir.const(134,'uint32')
c3=tir.const(1896389727,'uint32')
c4=tir.IntImm('bool',34)
c5=tir.IntImm('bool',377023664)
c6=tir.IntImm('bool',2181759036)
c7=tir.const(2010243692,'uint32')
c8=tir.const(3203233212,'uint32')
buffer_var = tvm.tir.Var("buf", tvm.ir.PointerType(tvm.ir.PrimType("uint32")))
x = tvm.tir.Allocate(buffer_var, "uint32", [], tir.Min(c4,c5), tir.Evaluate(1))
for1=tir.For(v1,c2,c3,0,tir.Evaluate(0))
for2=tir.For(v1,c1,c7,0,tir.Evaluate(0))
for3=tir.For(v1,c1,c8,0,tir.Evaluate(0))
if1=tir.IfThenElse(c6,x,for1)
if2=tir.IfThenElse(c6,x,for2)
if3=tir.IfThenElse(c6,x,for3)
f1=tir.PrimFunc({},if1)
f2=tir.PrimFunc({},if2)
f3=tir.PrimFunc({},if3)