[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-18 Thread Nathan Gauër via cfe-commits
@@ -59,6 +59,9 @@ enum class LangAS : unsigned { // HLSL specific address spaces. hlsl_groupshared, + // Vulkan specific address spaces. + vulkan_private, + Keenuts wrote: It breaks 1 test, but the test seems wrong anyway: test for SPV_INTEL_function_p

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-18 Thread Nathan Gauër via cfe-commits
@@ -59,6 +59,9 @@ enum class LangAS : unsigned { // HLSL specific address spaces. hlsl_groupshared, + // Vulkan specific address spaces. + vulkan_private, + Keenuts wrote: My understanding is we have 2 ways to convey this information from the FE to the

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-18 Thread Nathan Gauër via cfe-commits
@@ -379,6 +380,18 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<> &B, const ParmVarDecl &D, llvm::Type *Ty) { assert(D.hasAttrs() && "Entry parameter missing annotation a

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-18 Thread Nathan Gauër via cfe-commits
@@ -204,7 +204,11 @@ addressSpaceToStorageClass(unsigned AddrSpace, const SPIRVSubtarget &STI) { ? SPIRV::StorageClass::HostOnlyINTEL : SPIRV::StorageClass::CrossWorkgroup; case 7: +return SPIRV::StorageClass::Private; + case 8: return

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-18 Thread Nathan Gauër via cfe-commits
@@ -43,7 +43,7 @@ void neg() { template void tooBig() { - __attribute__((address_space(I))) int *bounds; // expected-error {{address space is larger than the maximum supported (8388586)}} + __attribute__((address_space(I))) int *bounds; // expected-error {{address space i

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-15 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/116393 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-15 Thread Steven Perron via cfe-commits
@@ -59,6 +59,9 @@ enum class LangAS : unsigned { // HLSL specific address spaces. hlsl_groupshared, + // Vulkan specific address spaces. + vulkan_private, + s-perron wrote: Do we need a new address space? This is not an issue specific to these input an

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-15 Thread Steven Perron via cfe-commits
@@ -379,6 +380,18 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<> &B, const ParmVarDecl &D, llvm::Type *Ty) { assert(D.hasAttrs() && "Entry parameter missing annotation a

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-15 Thread Steven Perron via cfe-commits
https://github.com/s-perron commented: This aligns with what I was thinking. Thanks. My only real question is if we have to use the new address space. We might need to figure out how to handle regular static variables first, and then we can revisit this. https://github.com/llvm/llvm-project/pu

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-15 Thread Steven Perron via cfe-commits
@@ -204,7 +204,11 @@ addressSpaceToStorageClass(unsigned AddrSpace, const SPIRVSubtarget &STI) { ? SPIRV::StorageClass::HostOnlyINTEL : SPIRV::StorageClass::CrossWorkgroup; case 7: +return SPIRV::StorageClass::Private; + case 8: return

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-15 Thread Steven Perron via cfe-commits
@@ -43,7 +43,7 @@ void neg() { template void tooBig() { - __attribute__((address_space(I))) int *bounds; // expected-error {{address space is larger than the maximum supported (8388586)}} + __attribute__((address_space(I))) int *bounds; // expected-error {{address space i

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-15 Thread Steven Perron via cfe-commits
@@ -164,6 +164,16 @@ def HLSLBufferObj : SubsetSubject(S)}], "cbuffer/tbuffer">; +def HLSLInputBuiltin : SubsetSubjecthasGlobalStorage() && S->getType().isConstQualified() && + S->getStorageClass()==StorageClass::SC_Static}], +

[clang] [llvm] [SPIR-V] DRAFT: Shader built-ins - no spec change (PR #116393)

2024-11-15 Thread Nathan Gauër via cfe-commits
https://github.com/Keenuts created https://github.com/llvm/llvm-project/pull/116393 Draft PR to explore adding semantics & inline SPIR-V for builtins. This PR is an alternative to #115187 which does not requires a spec change as we keep the variables as `static [const]`. In addition, it tried