Skip to content

[SPIR-V] Don't lower builtin variadic functions (cherry pick)#21663

Merged
sarnex merged 2 commits intointel:syclfrom
sarnex:cherrypick
Apr 1, 2026
Merged

[SPIR-V] Don't lower builtin variadic functions (cherry pick)#21663
sarnex merged 2 commits intointel:syclfrom
sarnex:cherrypick

Conversation

@sarnex
Copy link
Copy Markdown
Contributor

@sarnex sarnex commented Mar 31, 2026

Revert the workaround we did in pulldown here and cherry-pick the upstream fix here.

I will merge this into HEAD manually so we don't mess up the future pulldown, the PR title doesn't matter.

Postcommit run here.

sarnex added 2 commits March 31, 2026 12:36
In llvm/llvm-project#178980 I tried to remove
the special handling for `printf`, but the fix was wrong, the pass
expects that `printf` abides by the variadic ABI (single buffer passed
in, args extracted by caller), which isn't how it works.

However the root issue is with any builtin, they are just replaced
directly with instructions, and the only place that could generate code
to honor the variadic ABI would bei in the SPIR-V backend, and it would
be pretty complicated for pretty much no benefit.

It's much simpler to teach the pass to skip certain functions, as we did
before, but this time skip all SPIR-V builtin.

---------

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
@sarnex sarnex marked this pull request as ready for review March 31, 2026 20:50
@sarnex sarnex requested a review from a team as a code owner March 31, 2026 20:50
@sarnex sarnex requested review from YuriPlyakhin and jsji March 31, 2026 20:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

@intel/llvm-gatekeepers please consider merging

@sarnex sarnex merged commit cd15588 into intel:sycl Apr 1, 2026
76 of 77 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