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

The compiler produce invalid spirv with enabled PhysicalPointerArgsPass. #1418

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexDemydenko
Copy link
Contributor

@AlexDemydenko AlexDemydenko commented Nov 10, 2024

The tool spirv-val return errors for some spirv binaries.

The test list with OpenCL-CTS:

vector_swizzle

Kernel example:
vector-swizzle.txt

@AlexDemydenko AlexDemydenko force-pushed the GFXSW-50817 branch 2 times, most recently from ae40adf to 75101bd Compare November 14, 2024 11:38
@lpavank
Copy link
Contributor

lpavank commented Nov 18, 2024

@alan-baker and @rjodinchr, do you any inputs for @AlexDemydenko on this issue/PR?

@alan-baker
Copy link
Collaborator

What kinds of errors? When I run:

clspv vector-swizzle.cl -o vector-swizzle.spv -int8=1 -physical-storage-buffers -arch=spir64

The resulting binary passes spirv-val. What command line are you using?

@rjodinchr
Copy link
Collaborator

This is at least missing a test I would say.

@AlexDemydenko
Copy link
Contributor Author

AlexDemydenko commented Nov 20, 2024

Command line from the clvk driver:

clspv -cl-std=CL3.0 -no-8bit-storage=pushconstant -no-16bit-storage=pushconstant -spv-version=1.6 -arch=spir64 -physical-storage-buffers vector-swizzle.cl

Error from spirv-val:

error: line 99: OpPtrAccessChain result type (OpTypeInt) does not match the type that results from indexing into the base <id> (OpTypeVector).
  %56 = OpPtrAccessChain %_ptr_PhysicalStorageBuffer_uint %37 %uint_4

The tool spirv-val return errors for some spirv binaries.
@AlexDemydenko
Copy link
Contributor Author

ping

Copy link
Collaborator

@rjodinchr rjodinchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add another test using clspv-opt targeting the replace-pointer-bitcast pass only.
Thank you

@@ -354,6 +354,11 @@ void ComputeStore(IRBuilder<> &Builder, StoreInst *ST, Value *OrgGEPIdx,
unsigned DstEleTyBitWidth = SizeInBits(Builder, DstEleTy);

Type *OrigSrcTy = SrcTy;
if (dyn_cast<IntToPtrInst>(Src)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment to explain what is happening here, and why it is needed

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.

5 participants