tqchen opened a new pull request, #19733:
URL: https://github.com/apache/tvm/pull/19733

   After the LetStmt -> Bind flattening (#18874) and the TIRx bringup
   (#18913), the TVMScript frontend lowers a let-binding such as
   `val = T.undef()` into a zero-dimensional local scalar buffer rather
   than a Bind/LetStmt node:
   
   ```
   AllocBuffer(val, scope="local")
   val[0] = T.undef()
   A[0] = val[0]        # for A[0] = val
   A[val[0]] = 5        # for A[val] = 5
   ```
   
   `RemoveStoreUndef` only tracked undef through Bind-bound Vars, so a store
   whose value came from such a scalar buffer was no longer removed, and undef
   reaching a buffer index through that buffer no longer raised. This regressed
   `test_remove_let_undef` and `test_raise_error_for_undef_as_store_indices`.
   
   This PR makes the locator record a buffer whose stored value contains undef
   and treat any subsequent `BufferLoad` of it as undef, mirroring the prior
   let-bound-Var propagation. The remover drops those undef stores, the now
   dead `AllocBuffer` of the scalar buffer, and propagates the index-undef
   error. The existing Bind/Var handling is retained for any remaining Bind
   nodes.
   
   All tests in 
`tests/python/s_tir/transform/test_s_tir_transform_remove_undef.py`
   pass (6 passed).
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to