[clang] [HLSL][SPIRV] Add option to add all KHR extensions (PR #145536)

2025-06-26 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/145536 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add option to add all KHR extensions (PR #145536)

2025-06-26 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/145536 >From af0773cd9677d90d2fe2466fa113d70983fc2c32 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Tue, 24 Jun 2025 11:41:12 -0400 Subject: [PATCH 1/2] [HLSL][SPIRV] Add option to add all KHR extensions In DXC,

[clang] [HLSL][SPIRV] Handle `uint` type for spec constant (PR #145577)

2025-06-26 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/145577 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add option for VK layouts (PR #145327)

2025-06-25 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/145327 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement `SpirvType` and `SpirvOpaqueType` (PR #134034)

2025-06-25 Thread Steven Perron via cfe-commits
@@ -4855,6 +4857,17 @@ LinkageInfo LinkageComputer::computeTypeLinkageInfo(const Type *T) { return computeTypeLinkageInfo(cast(T) ->getContainedType() ->getCanonicalTypeInternal()); + case Type::H

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-25 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/144774 >From 7d3d8bb30863dd860183f7b9635aa34b72a9c3ae Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 18 Jun 2025 09:19:45 -0400 Subject: [PATCH 1/3] [HLSL][SPRIV] Handle sign RWBuffer correctly MIME-Version:

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-25 Thread Steven Perron via cfe-commits
s-perron wrote: @michalpaszkowski The SPIR-V backend meeting was canceled, so we won't be able to talk about this there. Do you have any feedback? https://github.com/llvm/llvm-project/pull/144774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [HLSL][SPIRV] Handle `uint` type for spec constant (PR #145577)

2025-06-24 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/145577 The testing only tried `unsigned int` and not `uint`. We want to correctly handle these surgared types as specialization constants. >From 2bed922b3bd084fa43c8dc1843fb5bf67731e5ab Mon Sep 17 00:00:00 2001 From:

[clang] [HLSL][SPIRV] Handle `uint` type for spec constant (PR #145577)

2025-06-24 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/145577 >From 44cb96a30dc3b2b28449661a52ac5a73c63e2139 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Tue, 24 Jun 2025 15:44:10 -0400 Subject: [PATCH] [HLSL][SPIRV] Handle `uint` type for spec constant The testing

[clang] [HLSL][SPIRV] Add option to add all KHR extensions (PR #145536)

2025-06-24 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/145536 In DXC, there is an option to enable all KHR extension. This is added by passing the KHR option to the SPIR-V backend, which will enable all of the appropriate extensions. Part of https://github.com/llvm/llvm-p

[clang] [HLSL] Add option for VK layouts (PR #145327)

2025-06-24 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/145327 >From 43f9f0e69c121c25f0519340f2aaa236f9820cba Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Thu, 19 Jun 2025 14:27:46 -0400 Subject: [PATCH] [HLSL] Add option for VK layouts We add the options to the dri

[clang] [HLSL] Don't use CreateRuntimeFunction for intrinsics (PR #145334)

2025-06-23 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. https://github.com/llvm/llvm-project/pull/145334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

2025-06-23 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/144934 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add option for VK layouts (PR #145327)

2025-06-23 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/145327 We add the options to the driver, so that the one option that is being implemented at this time can be used. Issue an error for the other options. When we start to implement the other options, we will have to f

[clang] scalar layout (PR #145063)

2025-06-20 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/145063 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Boolean in a RawBuffer should be i32 and Boolean vector in a RawBuffer should be (PR #144929)

2025-06-20 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. https://github.com/llvm/llvm-project/pull/144929 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] scalar layout (PR #145063)

2025-06-20 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/145063 - **[HLSL][SPIRV] Allow large z value in numthreads** - **Implement DXC layout cli options.** - **[HLSL] Add option for VK layouts** >From 0b809d5a51a76ef76a68574b8dc447de10d4654a Mon Sep 17 00:00:00 2001 From

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-20 Thread Steven Perron via cfe-commits
s-perron wrote: @michalpaszkowski Any problems with me creating the new parallel type `spirv.SignedImage`? https://github.com/llvm/llvm-project/pull/144774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

2025-06-20 Thread Steven Perron via cfe-commits
@@ -1033,12 +1033,15 @@ void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) { void SemaHLSL::handleNumThreadsAttr(Decl *D, const ParsedAttr &AL) { llvm::VersionTuple SMVersion = getASTContext().getTargetInfo().getTriple().getOSVersion(); + bool IsDXI

[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

2025-06-19 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/144934 The current validation checks for numthreads assume that the target is DXIL so the version checks inadvertently issue error when targeting SPIR-V. >From 0b809d5a51a76ef76a68574b8dc447de10d4654a Mon Sep 17 00:0

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-19 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/144774 >From 7d3d8bb30863dd860183f7b9635aa34b72a9c3ae Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 18 Jun 2025 09:19:45 -0400 Subject: [PATCH 1/3] [HLSL][SPRIV] Handle sign RWBuffer correctly MIME-Version:

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-19 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/144774 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-19 Thread Steven Perron via cfe-commits
@@ -346,8 +346,9 @@ bool sampledTypeIsSignedInteger(const llvm::Type *HandleType) { if (TET->getTargetExtName() == "spirv.Image") { return false; } - return TET->getTypeParameter(0)->isIntegerTy(); -} + assert(TET->getTargetExtName() == "spirv.SignedImage") { +re

[clang] [HLSL][SPIRV] Reapply "[HLSL][SPIRV] Add vk::constant_id attribute." (PR #144902)

2025-06-19 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/144902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Reapply "[HLSL][SPIRV] Add vk::constant_id attribute." (PR #144902)

2025-06-19 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/144902 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-19 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/144774 >From 7d3d8bb30863dd860183f7b9635aa34b72a9c3ae Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 18 Jun 2025 09:19:45 -0400 Subject: [PATCH 1/2] [HLSL][SPRIV] Handle sign RWBuffer correctly MIME-Version:

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-19 Thread Steven Perron via cfe-commits
@@ -341,6 +341,13 @@ class SPIRVInstructionSelector : public InstructionSelector { GIntrinsic &HandleDef, MachineInstr &Pos) const; }; +bool sampledTypeIsSignedInteger(const llvm::Type *HandleType) { + const TargetExtType *TET = cast(HandleTy

[clang] [llvm] [HLSL][SPRIV] Handle signed RWBuffer correctly (PR #144774)

2025-06-19 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/144774 >From 7d3d8bb30863dd860183f7b9635aa34b72a9c3ae Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 18 Jun 2025 09:19:45 -0400 Subject: [PATCH] [HLSL][SPRIV] Handle sign RWBuffer correctly MIME-Version: 1.0

[clang] Revert "[HLSL][SPIRV] Add vk::constant_id attribute." (PR #144812)

2025-06-18 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/144812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[HLSL][SPIRV] Add vk::constant_id attribute." (PR #144812)

2025-06-18 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/144812 Reverts llvm/llvm-project#143544 >From 9d775256000726929f826ec164aa514d4a6e2288 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 18 Jun 2025 19:30:17 -0400 Subject: [PATCH] Revert "[HLSL][SPIRV] Add vk:

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-18 Thread Steven Perron via cfe-commits
s-perron wrote: https://lab.llvm.org/buildbot/#/builders/24/builds/9606 https://github.com/llvm/llvm-project/pull/143544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] signed buffer (PR #144774)

2025-06-18 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/144774 - **Add sign extend image operand.** - **[HLSL][SPRIV] Handle sign RWBuffer correctly** >From 488fb5961105305e50e3d787f286354754a73fe9 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 18 Jun 2025 09:19

[clang] [llvm] [HLSL][SPIR-V] Fix LinkageAttribute emission for BuiltIn (PR #144701)

2025-06-18 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. https://github.com/llvm/llvm-project/pull/144701 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Use hidden visibility for external linkage. (PR #140292)

2025-06-16 Thread Steven Perron via cfe-commits
@@ -1661,6 +1661,11 @@ void CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV, return; } + if (Context.getLangOpts().HLSL && !D->isInExportDeclContext()) { +GV->setVisibility(llvm::GlobalValue::HiddenVisibility); s-perron wrote: I'll look i

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-16 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/143544 >From 954a86f3c8da88c4ac276231a40cd88e6f628253 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Fri, 30 May 2025 12:32:21 -0400 Subject: [PATCH 1/7] [HLSL][SPIRV] Add vk::constant_id attribute. The vk::const

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-13 Thread Steven Perron via cfe-commits
s-perron wrote: Broken builds fixed by #144116 https://github.com/llvm/llvm-project/pull/143412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Run finalize linkage pass for all targets (PR #134260)

2025-06-13 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/134260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Run finalize linkage pass for all targets (PR #134260)

2025-06-13 Thread Steven Perron via cfe-commits
s-perron wrote: In discussions with the teams implementing HLSL, we changed the design for the `export` keyword in HLSL. See https://github.com/llvm/wg-hlsl/blob/02098f6d85af1534c296c71790a24df55bd40374/proposals/0026-symbol-visibility.md https://github.com/llvm/llvm-project/pull/134260 _

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-13 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/143412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Use hidden visibility for external linkage. (PR #140292)

2025-06-13 Thread Steven Perron via cfe-commits
https://github.com/s-perron ready_for_review https://github.com/llvm/llvm-project/pull/140292 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-11 Thread Steven Perron via cfe-commits
@@ -213,7 +213,8 @@ getScopeFromNormalizedScopeName(StringRef ScopeName) { .Case("vk", AttributeCommonInfo::Scope::VK) .Case("msvc", AttributeCommonInfo::Scope::MSVC) .Case("omp", AttributeCommonInfo::Scope::OMP) - .Case("riscv", AttributeCommonInfo::Scop

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-11 Thread Steven Perron via cfe-commits
@@ -774,6 +775,77 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, return EmitRuntimeCall( Intrinsic::getOrInsertDeclaration(&CGM.getModule(), ID)); } + case Builtin::BI__builtin_get_spirv_spec_constant_bool: + case Builtin::BI__builtin_get_sp

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-11 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/143544 >From 954a86f3c8da88c4ac276231a40cd88e6f628253 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Fri, 30 May 2025 12:32:21 -0400 Subject: [PATCH 1/3] [HLSL][SPIRV] Add vk::constant_id attribute. The vk::const

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-11 Thread Steven Perron via cfe-commits
@@ -213,7 +213,8 @@ getScopeFromNormalizedScopeName(StringRef ScopeName) { .Case("vk", AttributeCommonInfo::Scope::VK) .Case("msvc", AttributeCommonInfo::Scope::MSVC) .Case("omp", AttributeCommonInfo::Scope::OMP) - .Case("riscv", AttributeCommonInfo::Scop

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-11 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/143412 >From fadeeac5a79cbae0edffbabbe383d7451c254afb Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Mon, 9 Jun 2025 12:53:06 -0400 Subject: [PATCH 1/2] [HLSL][SPIRV] Use resource names The SPIR-V backend does no

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-11 Thread Steven Perron via cfe-commits
@@ -243,7 +243,7 @@ CGHLSLRuntime::getCreateHandleFromBindingIntrinsic() { case llvm::Triple::dxil: return std::pair(llvm::Intrinsic::dx_resource_handlefrombinding, true); case llvm::Triple::spirv: -return std::pair(llvm::Intrinsic::spv_resource_handlefrombinding, f

[clang] [HLSL][Driver] Make vk1.3 the default. (PR #143384)

2025-06-11 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/143384 >From ee4c25c47d58ba8707d8a36934186bce3c9fde4f Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Mon, 9 Jun 2025 10:21:47 -0400 Subject: [PATCH 1/2] [HLSL][Driver] Make vk1.3 the default. The HLSL driver curr

[clang] [HLSL][Driver] Make vk1.3 the default. (PR #143384)

2025-06-10 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/143384 >From ee4c25c47d58ba8707d8a36934186bce3c9fde4f Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Mon, 9 Jun 2025 10:21:47 -0400 Subject: [PATCH 1/2] [HLSL][Driver] Make vk1.3 the default. The HLSL driver curr

[clang] [HLSL][SPIR-V] Change SPV AS map for groupshared (PR #143519)

2025-06-10 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. https://github.com/llvm/llvm-project/pull/143519 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-10 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/143544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)

2025-06-10 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/143544 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #142638)

2025-06-10 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/142638 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143180)

2025-06-10 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/143180 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-09 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/143412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-09 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/143412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-09 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/143412 >From fadeeac5a79cbae0edffbabbe383d7451c254afb Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Mon, 9 Jun 2025 12:53:06 -0400 Subject: [PATCH] [HLSL][SPIRV] Use resource names The SPIR-V backend does not ha

[clang] [llvm] [HLSL][SPIRV] Use resource names (PR #143412)

2025-06-09 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/143412 None >From 20eb30e74884a8327f2f0fa7f357a1434347b0c4 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Mon, 9 Jun 2025 12:53:06 -0400 Subject: [PATCH] [HLSL][SPIRV] Use resource names --- clang/lib/CodeGen/C

[clang] [HLSL][Driver] Make vk1.3 the default. (PR #143384)

2025-06-09 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/143384 The HLSL driver currently defaults the triple to an unversioned os and subarch when targeting SPIR-V. This means the SPIR-V backend decides the default value. That is not a great option because a change the back

[clang] [llvm] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143180)

2025-06-09 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/143180 >From de57697e0f9b0f9d4bb5be7ca6be631fe2502484 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Fri, 30 May 2025 12:32:21 -0400 Subject: [PATCH] [HLSL][SPIRV] Add vk::constant_id attribute. The vk::constant_

[clang] [HLSL] Use ExtVector for firstbit intrinsics (PR #142679)

2025-06-06 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. https://github.com/llvm/llvm-project/pull/142679 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143180)

2025-06-06 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/143180 The vk::constant_id attribute is used to indicate that a global const variable represents a specialization constant in SPIR-V. This PR adds this attribute to clang. The documetation for the attribute is [here]

[clang] [llvm] [HLSL] Add WaveGetLaneCount() intrinsic to FE (PR #143127)

2025-06-06 Thread Steven Perron via cfe-commits
Nathan =?utf-8?q?Gau=C3=ABr?= Message-ID: In-Reply-To: https://github.com/s-perron approved this pull request. https://github.com/llvm/llvm-project/pull/143127 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [HLSL][SPIR-V] Handle SV_Postion builtin in PS (PR #141759)

2025-06-06 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/141759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIR-V] Handle SV_Postion builtin in PS (PR #141759)

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

[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #142638)

2025-06-03 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/142638 The vk::constant_id attribute is used to indicate that a global const variable represents a specialization constant in SPIR-V. This PR adds this attribute to clang. The documetation for the attribute is [here]

[clang] [SPIR-V] Only emit __spirv__ when targeting HLSL (PR #142401)

2025-06-02 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. https://github.com/llvm/llvm-project/pull/142401 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Implement the SPIR-V target type for cbuffers. (PR #140061)

2025-05-28 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/140061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Use hidden visibility for external linkage. (PR #140292)

2025-05-16 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/140292 >From af7ac509a1bf1baf14d5d50ebe72a5d95ef9 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Fri, 16 May 2025 14:21:01 -0400 Subject: [PATCH] [HLSL] Use hidden visibility for external linkage. Implements

[clang] [llvm] [HLSL] Use hidden visibility for external linkage. (PR #140292)

2025-05-16 Thread Steven Perron via cfe-commits
s-perron wrote: FYI: @pow2clk Here is a possible implementation for https://github.com/llvm/wg-hlsl/blob/main/proposals/0026-symbol-visibility.md. I still need to update tests, but the change seems simple enough. https://github.com/llvm/llvm-project/pull/140292

[clang] [llvm] [HLSL] Use hidden visibility for external linkage. (PR #140292)

2025-05-16 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/140292 Implements https://github.com/llvm/wg-hlsl/blob/main/proposals/0026-symbol-visibility.md. The change is to stop using the `hlsl.export` attribute. Instead, symbols with "program linkage" in HLSL will have expor

[clang] [HLSL][SPIRV] Implement the SPIR-V target type for cbuffers. (PR #140061)

2025-05-16 Thread Steven Perron via cfe-commits
https://github.com/s-perron ready_for_review https://github.com/llvm/llvm-project/pull/140061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Implement the SPIR-V target type for cbuffers. (PR #140061)

2025-05-16 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/140061 Rate limit · GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-

[clang] [llvm] [SPIRV] Add PreLegalizer instCombine for `faceforward` (PR #139959)

2025-05-16 Thread Steven Perron via cfe-commits
https://github.com/s-perron commented: I have a minor concern about how specific the `N` and `0-N` checks are. Otherwise this looks good to me. https://github.com/llvm/llvm-project/pull/139959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [llvm] [SPIRV] Add PreLegalizer instCombine for `faceforward` (PR #139959)

2025-05-16 Thread Steven Perron via cfe-commits
@@ -98,21 +110,98 @@ void applySPIRVDistance(MachineInstr &MI, MachineRegisterInfo &MRI, SPIRVGlobalRegistry *GR = MI.getMF()->getSubtarget().getSPIRVGlobalRegistry(); - auto RemoveAllUses = [&](Register Reg) { -SmallVector UsesToErase( -llvm::make_pointe

[clang] [llvm] [SPIRV] Add PreLegalizer instCombine for `faceforward` (PR #139959)

2025-05-16 Thread Steven Perron via cfe-commits
@@ -98,21 +110,98 @@ void applySPIRVDistance(MachineInstr &MI, MachineRegisterInfo &MRI, SPIRVGlobalRegistry *GR = MI.getMF()->getSubtarget().getSPIRVGlobalRegistry(); - auto RemoveAllUses = [&](Register Reg) { -SmallVector UsesToErase( -llvm::make_pointe

[clang] [llvm] [SPIRV] Add PreLegalizer instCombine for `faceforward` (PR #139959)

2025-05-16 Thread Steven Perron via cfe-commits
https://github.com/s-perron edited https://github.com/llvm/llvm-project/pull/139959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emit convergence tokens for loop in global array init (PR #140120)

2025-05-15 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/140120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Emit convergence tokens for loop in global array init (PR #140120)

2025-05-15 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/140120 When initializing a global array, a loop is generated, but no convergence is emitted for the loop. This fixes that up. >From 65ba89dc7c1496c4ff5f194c34472e308402b47d Mon Sep 17 00:00:00 2001 From: Steven Perro

[clang] [HLSL][SPIRV] Implement the SPIR-V target type for cbuffers. (PR #140061)

2025-05-15 Thread Steven Perron via cfe-commits
https://github.com/s-perron converted_to_draft https://github.com/llvm/llvm-project/pull/140061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Implement the SPIR-V target type for cbuffers. (PR #140061)

2025-05-15 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/140061 This change implement the type used to represent cbuffer for SPIR-V. Fixes https://github.com/llvm/llvm-project/issues/138274. Rate limit · GitHub body { backgr

[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

2025-05-05 Thread Steven Perron via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: s-perron wrote: Could you add a tests to [SemaHLSL](https://github.com/llvm/llvm-project/tree/44856d957e3a878e1f15d5ab0009bff9c

[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

2025-05-05 Thread Steven Perron via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -5759,9 +5761,18 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D, getCUDARuntime().internalizeDeviceSideVar(D, Linkage);

[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

2025-05-05 Thread Steven Perron via cfe-commits
Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= , Nathan =?utf-8?q?Gauër?= Message-ID: In-Reply-To: @@ -5636,6 +5636,8 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D, Init = llvm::UndefValue::get(getTypes().ConvertTypeForMem

[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

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

[clang] [llvm] [HLSL][SPIR-V] Implement vk::ext_builtin_input attribute (PR #138530)

2025-05-05 Thread Steven Perron via cfe-commits
https://github.com/s-perron approved this pull request. LGTM. https://github.com/llvm/llvm-project/pull/138530 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add CLI option `-fspv-extension` (PR #137985)

2025-05-02 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/137985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add CLI option `-fspv-extension` (PR #137985)

2025-05-02 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/137985 >From d44ed16655870a2435023dc7a4289ea8b3073071 Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Mon, 28 Apr 2025 15:55:31 -0400 Subject: [PATCH 1/2] [HLSL][SPIRV] Add CLI option `-fspv-extension` This commit

[clang] [llvm] [HLSL] Run finalize linkage pass for all targets (PR #134260)

2025-04-30 Thread Steven Perron via cfe-commits
https://github.com/s-perron reopened https://github.com/llvm/llvm-project/pull/134260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][SPIRV] Add CLI option `-fspv-extension` (PR #137985)

2025-04-30 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/137985 This commit implements DXC's `-fspv-extension` options. It is implemented by replaced it with the equivalent `-spirv-ext` option. Note that if the option is not used, that is the same as enabling all extension,

[clang] [llvm] [HLSL] Run finalize linkage pass for all targets (PR #134260)

2025-04-30 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/134260 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow non `.hlsl` files as source files (PR #137378)

2025-04-29 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/137378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow non `.hlsl` files as source files (PR #137378)

2025-04-28 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/137378 >From 163b214e77e63d919ea7fdd1e52762263037175d Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Fri, 25 Apr 2025 13:16:53 -0400 Subject: [PATCH 1/2] [HLSL] Allow non `.hlsl` files as source files Changes the

[clang] [HLSL] Allow non `.hlsl` files as source files (PR #137378)

2025-04-25 Thread Steven Perron via cfe-commits
https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/137378 Changes the driver to assume input file with an unknown extension are HLSL source files instead of object files. Fixes https://github.com/llvm/llvm-project/issues/137370 >From 163b214e77e63d919ea7fdd1e5276226

[clang] [llvm] [HLSL] Run finalize linkage pass for all targets (PR #134260)

2025-04-24 Thread Steven Perron via cfe-commits
s-perron wrote: > The idea that a symbol should be externally visible before linking, and not > externally visible afterwards, isn't new: many platforms have some form of > symbol visibility. I'm not sure why you don't want to express that in LLVM > IR... having an implicit HLSL-specific rule

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-22 Thread Steven Perron via cfe-commits
https://github.com/s-perron closed https://github.com/llvm/llvm-project/pull/127675 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-22 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/127675 >From 2a288bc3528ae63f05551492518cbf500689108d Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 12 Feb 2025 15:45:32 -0500 Subject: [PATCH 1/6] [HLSL] Use hlsl_device address space for getpointer. We ad

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-22 Thread Steven Perron via cfe-commits
@@ -89,12 +89,12 @@ RESOURCE Buffer; // CHECK-SAME{LITERAL}: [[hlsl::raw_buffer]] // CHECK-SAME{LITERAL}: [[hlsl::contained_type(element_type)]] -// CHECK-SUBSCRIPT: CXXMethodDecl {{.*}} operator[] 'const element_type &(unsigned int) const' +// CHECK-SUBSCRIPT: CXXMethodDecl

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-22 Thread Steven Perron via cfe-commits
@@ -121,15 +121,15 @@ RESOURCE Buffer; // CHECK-SUBSCRIPT-NEXT: DeclRefExpr {{.*}} 'unsigned int' ParmVar {{.*}} 'Index' 'unsigned int' // CHECK-SUBSCRIPT-NEXT: AlwaysInlineAttr {{.*}} Implicit always_inline -// CHECK-NOSUBSCRIPT-NOT: CXXMethodDecl {{.*}} operator[] 'const el

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-22 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/127675 >From 2a288bc3528ae63f05551492518cbf500689108d Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 12 Feb 2025 15:45:32 -0500 Subject: [PATCH 1/5] [HLSL] Use hlsl_device address space for getpointer. We ad

[clang] [HLSL] Use hlsl_device address space for getpointer. (PR #127675)

2025-04-22 Thread Steven Perron via cfe-commits
https://github.com/s-perron updated https://github.com/llvm/llvm-project/pull/127675 >From 81c31fcdee28482ceea703064b0103eccb2a93ad Mon Sep 17 00:00:00 2001 From: Steven Perron Date: Wed, 12 Feb 2025 15:45:32 -0500 Subject: [PATCH 1/5] [HLSL] Use hlsl_device address space for getpointer. We ad

  1   2   3   4   >