Allow address space cast for function pointer when Intel function pointer extension is available#3786
Open
jinge90 wants to merge 2 commits into
Open
Allow address space cast for function pointer when Intel function pointer extension is available#3786jinge90 wants to merge 2 commits into
jinge90 wants to merge 2 commits into
Conversation
pointer extension is available Signed-off-by: jinge90 <ge.jin@intel.com>
Signed-off-by: jinge90 <ge.jin@intel.com>
MrSidims
reviewed
Jun 22, 2026
MrSidims
left a comment
Contributor
There was a problem hiding this comment.
Could you please provide a link with a spec change, which allows such cast?
| SPIRVEC_InvalidModule, U, | ||
| "Casts from CodeSectionINTEL address space require " | ||
| "SPV_INTEL_function_pointers extension\n"); | ||
| BOC = OpBitcast; |
Contributor
There was a problem hiding this comment.
No bitcast please. It should be a storage cast.
| ; RUN: llvm-spirv %t.spv -to-text -o %t.spt | ||
| ; RUN: FileCheck < %t.spt %s | ||
|
|
||
| ; CHECK: Bitcast {{[0-9]+}} [[#]] [[#]] |
Contributor
There was a problem hiding this comment.
The test currently checks nothing. Add checks for type and operands.
|
|
||
| ; RUN: llvm-spirv %s -spirv-ext=+SPV_INTEL_function_pointers -spirv-emit-function-ptr-addr-space -o %t.spv | ||
| ; RUN: llvm-spirv %t.spv -to-text -o %t.spt | ||
| ; RUN: FileCheck < %t.spt %s |
Contributor
There was a problem hiding this comment.
What is LLVM IR after the round trip?
Comment on lines
+1
to
+2
| ; Test that addrspacecast for CodeSectionINTEL (addrspace 9) does not | ||
| ; produce an error when SPV_INTEL_function_pointers is enabled. |
Contributor
There was a problem hiding this comment.
I believe it's mustn't be the goal of the test. Instead we must check, what SPIR-V is produced, because you are not only preventing a crash/error, but introducing new SPIR-V pattern.
Comment on lines
+1722
to
+1723
| "Casts from CodeSectionINTEL address space require " | ||
| "SPV_INTEL_function_pointers extension\n"); |
Contributor
There was a problem hiding this comment.
The error will never fire.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.