Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpAsmTargetINTEL operand #468

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jdnk
Copy link

@jdnk jdnk commented Dec 19, 2024

The OpAsmTargetINTEL instruction had an extra Result Type operand which is not specified in the extension https://github.com/intel/llvm/blob/sycl/sycl/doc/design/spirv-extensions/SPV_INTEL_inline_assembly.asciidoc. This causes errors in tools relying on the headers.

Small example of the failure:

// foo.c
void foo (const float * restrict a, const float * restrict b, float * restrict c) {
    __asm__ ("nop");
}

Compile to .spt via llc:

clang -S -emit-llvm -O3 foo.c -o foo.ll
llc -O3 -mtriple=spirv64-unknown-unknown --spirv-ext=+SPV_INTEL_inline_assembly foo.ll -o foo.spt

The output contains something like %12 = OpAsmTargetINTEL "spirv64-unknown-unknown", without any result type. Then, running spirv-as foo.spt -o foo.spv fails because return type is expected.

Tagging @mmerecki who worked on the extension.

@CLAassistant
Copy link

CLAassistant commented Dec 19, 2024

CLA assistant check
All committers have signed the CLA.

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.

4 participants