[TIRx] Add a dedicated boolean buffer lowering pass#19873
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a dedicated LowerBoolBuffer pass to replace boolean buffers with an int8 backing array, moving this logic out of FlattenBuffer and LayoutApplier. The new pass is integrated into the compilation pipelines to run after buffer flattening and before loop vectorization. Feedback on the changes suggests handling SBlockNode within the BoolBufferLegalizer to properly remap boolean buffers referenced or allocated inside blocks. Additionally, it is recommended to use new_buf->dtype instead of hardcoding DataType::Int(8) during load and store casts to improve code robustness.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Signed-off-by: Guan-Ming (Wesley) Chiu <105915352+guan404ming@users.noreply.github.com>
|
actually i am not sure if bool to int8 lowering is still needed given we migrated into DLPack bool recently and now bool is native bool(8bit), cc @tlopex |
Why
The bool→int8 backing-array conversion was duplicated inline across
FlattenBufferandLowerTIRxCleanup.How
LowerBoolBufferpass that rewritesboolbuffers toint8and inserts load/store casts.FlattenBufferandLowerTIRxCleanup.