altanh opened a new issue #10831:
URL: https://github.com/apache/tvm/issues/10831


   ### Expected behavior
   
   The code should build.
   
   ### Actual behavior
   
   TVM complains about undefined variables, when there are none.
   
   ### Environment
   
   Reproduced on main.
   
   ### Steps to reproduce
   
   ```
   import tvm
   from tvm.script import tir as T
   
   
   @T.prim_func
   def bug(a: T.handle):
       A = T.match_buffer(a, (1,))
   
       A_pack = T.alloc_buffer((64, 8), "float32", scope="local")
       B_pack = T.alloc_buffer((64, 8), "float32", scope="local")
       C_reg = T.alloc_buffer((8, 8), "float32", scope="local")
   
       for loop in range(100000):
           for rk in range(64):
               for rii, rjj in T.grid(8, 8):
                   C_reg[rii, rjj] = T.float32(0)
               for riijj in T.vectorized(8 * 8):
                   rii: T.int32 = riijj // 8
                   rjj: T.int32 = riijj % 8
                   C_reg[rii, rjj] += A_pack[rk, rii] * B_pack[rk, rjj]
   
   
   if __name__ == "__main__":
       print(bug)
   
       with tvm.transform.PassContext(opt_level=3):
           mod = tvm.build(bug, target="llvm")
   ```
   I get errors about `rii` and `rjj` when building.
   
   cc @junrushao1994 @vinx13 


-- 
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