Skip to content

[hal] Add ObjectLike trait to hal.executable.source#23958

Open
jtuyls wants to merge 1 commit intoiree-org:mainfrom
jtuyls:fix/hal-executable-source-objectlike
Open

[hal] Add ObjectLike trait to hal.executable.source#23958
jtuyls wants to merge 1 commit intoiree-org:mainfrom
jtuyls:fix/hal-executable-source-objectlike

Conversation

@jtuyls
Copy link
Copy Markdown
Contributor

@jtuyls jtuyls commented Mar 30, 2026

Every other executable op in the pipeline (flow.executable, stream.executable, hal.executable) has ObjectLike. hal.executable.source seems to satisfy the same requirements: symbol table, isolated from above, only referenced by symbol.

This PR adds the trait as it matters for iree-link: when linking input-level MLIR modules that use extern dispatch, hal.executable.source ops are transitive symbol dependencies of the linked functions (referenced via flow.dispatch @name::@export). Without ObjectLike, the linker's symbol indexing skips them (LinkModules.cpp filters IsolatedFromAbove ops that aren't ObjectLike or FunctionOpInterface), causing silent "unresolved external symbol" errors.

All 10 ObjectLike consumers in the compiler handle hal.executable.source correctly: analysis passes (affinity, device, async copy) skip it, DeduplicateExecutables can deduplicate it, and MaterializeInterfaces already processes it explicitly by type.

@jtuyls jtuyls requested a review from benvanik as a code owner March 30, 2026 09:16
@jtuyls jtuyls force-pushed the fix/hal-executable-source-objectlike branch from f88f427 to d64222a Compare March 30, 2026 09:18
Every other executable op in the pipeline (flow.executable,
stream.executable, hal.executable) has ObjectLike. `hal.executable.source`
satisfies the same requirements — symbol table, isolated from above, only
referenced by symbol — but was missing the trait.

This matters for iree-link: when linking input-level MLIR modules that
use extern dispatch, hal.executable.source ops are transitive symbol
dependencies of the linked functions (referenced via `flow.dispatch
@name::@export`). Without ObjectLike, the linker's symbol indexing skips
them (LinkModules.cpp filters IsolatedFromAbove ops that aren't
ObjectLike or FunctionOpInterface), causing silent "unresolved external
symbol" errors.

All 10 ObjectLike consumers in the compiler handle hal.executable.source
correctly: analysis passes (affinity, device, async copy) skip it,
DeduplicateExecutables can deduplicate it, and MaterializeInterfaces
already processes it explicitly by type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Jorn <jorn.tuyls@gmail.com>
@jtuyls jtuyls force-pushed the fix/hal-executable-source-objectlike branch from d64222a to 6a4d8bc Compare March 30, 2026 09:28
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