Skip to content

[REFACTOR][IR] Promote primitive bitwise and shift operations to nodes - #20392

Merged
tqchen merged 1 commit into
apache:mainfrom
tqchen:task501-primitive-bitwise-nodes
Sep 20, 2026
Merged

tqchen merged 1 commit into
apache:mainfrom
tqchen:task501-primitive-bitwise-nodes

Conversation

@tqchen

@tqchen tqchen commented Sep 19, 2026

Copy link
Copy Markdown
Member

Primitive bitwise and shift expressions currently use generic intrinsic calls, requiring separate matching logic in analysis and lowering. This change introduces LShift, RShift, BitwiseAnd, BitwiseOr, BitwiseXor, and BitwiseNot nodes and migrates compiler consumers to typed operands. Public builders and operators retain their validation and constant-folding behavior.

The migration covers reflection and traversal, Python and TVMScript, symbolic analysis including Z3, Relax and TIR transforms, and C/LLVM/SPIR-V/WebGPU code generation. Existing tests receive representation-only updates.

Represent primitive shifts and bitwise expressions with dedicated nodes so traversal, symbolic analysis, rewriting, and code generation share typed operands. Preserve public builders and operators while replacing intrinsic-based dispatch throughout the compiler.
@tqchen
tqchen merged commit 7dcc6d9 into apache:main Sep 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants