Skip to content

[TASK] tvm PrimExpr unify with Expr - #9

Closed
tqchen wants to merge 5 commits into
stagingfrom
tvm-pr1-collapse-primexpr-typed-view-and-call
Closed

tqchen wants to merge 5 commits into
stagingfrom
tvm-pr1-collapse-primexpr-typed-view-and-call

Conversation

@tqchen

@tqchen tqchen commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Fork-local staging review before upstream submission.

tqchen added 5 commits June 27, 2026 03:51
Primitive expressions need to be representable as typed views over general Expr nodes so Relax and TIRX can share call handling without duplicating runtime node types.

This change moves primitive operators and literals onto ExprNode-backed typed refs, introduces a core ir.Call, and keeps Relax/TIRX wrapper APIs compatible for script printing, functors, and Python checks.
Keep known primitive-only nodes on the existing primitive expression node base while allowing PrimExpr to remain a typed view over any ExprNode with PrimType.

Remove the root-level GetPrimType helper and use local PrimExpr typed-view casts at unified CallNode sites before reading primitive result types.
Use an unregistered PrimOnlyExprBase for nodes that intrinsically carry PrimType while keeping CallNode and VarNode directly on ExprNode.

Use the tvm-ffi containment traits to preserve PrimExpr as a checked type view, simplify safe GetRef sites, and remove redundant namespace qualification.
@tqchen

tqchen commented Jun 28, 2026

Copy link
Copy Markdown
Owner Author

Superseded by private staging review https://github.com/tqchen/tvm-dev/pull/1 after exact branch and base migration.

@tqchen tqchen closed this Jun 28, 2026
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.

1 participant