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

   ## Summary
   
   - Preserve `None` when constructing a TIRx `AttrStmt` instead of treating it 
as a POD value to cast to `PrimExpr`.
   - Avoid visiting an undefined `PrimExpr` when an `AttrStmt` node is `None`.
   - Add an end-to-end regression covering construction and S-TIR purity 
analysis.
   
   ## Root cause
   
   `ffi::TypeIndex::kTVMFFINone` is below `kTVMFFISmallStr`, so the previous 
POD conversion condition also attempted to cast `None` to `PrimExpr`. In the 
path-aware TIR visitor, `Any::as<PrimExpr>()` can then yield an optional 
containing an undefined `PrimExpr`; visiting that value caused a segmentation 
fault. The reported baseline process exited with status 139.
   
   ## Upstream application
   
   The original proven fix commit (`c8c8c6f14f316cdef4e63591238efdf644b97576`) 
did not cherry-pick cleanly onto current `apache/main` because its visitor hunk 
was based on a fork-only iterative `AttrStmt` visitor. This PR reconstructs 
only the null-node fix directly on Apache commit 
`d02a68e403eb1b473844bd1b36302f44ac66dc32`. It does not include the iterative 
visitor or any Triton/TileLang changes.
   
   ## Validation
   
   - CPU-only macOS arm64 CMake build: passed (`cmake --build build --parallel 
8`)
   - Focused regression: `1 passed, 6 deselected`
   - `tests/python/tirx-base/test_tir_constructor.py` plus 
`tests/python/s_tir/analysis/test_s_tir_analysis_is_pure_function.py`: `25 
passed`
   - `clang-format --dry-run --Werror --style=file` on both changed C++ files: 
passed
   - Ruff 0.12.3 check and format check on the changed Python test: passed
   - `clang-tidy` `clang-analyzer-*` checks on both changed C++ files: passed
   - ASF header check, file-type check, and `git diff --check`: passed
   
   ## Residual risk
   
   Local runtime validation used a CPU-only build with LLVM, Z3, GPU backends, 
RPC, and optional libbacktrace disabled. The change is confined to TIRx 
construction and traversal; Apache CI should provide the broader build matrix.
   


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