https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/149363
WIP PR for the WG-HLSL semantic proposal
TODO: validate DXIL packing and SPIR-V location assignment.
From 8eb96a452cacee0e2284b6466351758db2bf3a80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
https://github.com/Keenuts approved this pull request.
https://github.com/llvm/llvm-project/pull/143909
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts approved this pull request.
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
https://github.com/Keenuts approved this pull request.
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
https://github.com/Keenuts approved this pull request.
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
Keenuts wrote:
> For the HLSL FE, there are already a few ids represented using intrinsics
> (unfortunately they use the DXIL naming rather than the SPIR-V but that's
> another point). I extended on that, were there reasons to not pursue this ?
The main reason was simplicity: we had many thing
Keenuts wrote:
> The advantage of intrinsics is they can be understood better by passes, it
> also creates an easier way for passes to introduce them (and less error
> prone). It's kinda pedantic TBH and I don't have strong opinions about them
> (it just feels cleaner to me). For the frontend
https://github.com/Keenuts 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
https://github.com/Keenuts approved this pull request.
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
@@ -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
https://github.com/Keenuts approved this pull request.
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
@@ -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
https://github.com/Keenuts approved this pull request.
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
@@ -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
Keenuts wrote:
This is not supposed to be merged no?
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
@@ -341,6 +341,13 @@ class SPIRVInstructionSelector : public
InstructionSelector {
GIntrinsic &HandleDef, MachineInstr &Pos)
const;
};
+bool sampledTypeIsSignedInteger(const llvm::Type *HandleType) {
+ const TargetExtType *TET = cast(HandleTy
Keenuts wrote:
You might want to change the PR title to add the tags etc
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
https://github.com/Keenuts approved this pull request.
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
https://github.com/Keenuts closed
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
https://github.com/Keenuts approved this pull request.
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
@@ -1661,6 +1661,11 @@ void
CodeGenModule::setGlobalVisibility(llvm::GlobalValue *GV,
return;
}
+ if (Context.getLangOpts().HLSL && !D->isInExportDeclContext()) {
+GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
Keenuts wrote:
GV at line 3
https://github.com/Keenuts approved this pull request.
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
@@ -12919,6 +12919,18 @@ def err_spirv_enum_not_int : Error<
def err_spirv_enum_not_valid : Error<
"invalid value for %select{storage class}0 argument">;
+def err_specialization_const_lit_init
+: Error<"variable with 'vk::constant_id' attribute cannot have an "
+
Keenuts wrote:
Hi, question, why did you prefer passing an new intrinsic to the SPIR-V backend
vs loading a global variable with the BuiltIn decoration?
For example, when building `SV_Position` semantic in HLSL, we emit a global
variable in the FE in the `Input` SC, along with the correct `spi
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/143519
From 9eb9d28d844e4427da5c9cc4f13b9263aae48ece Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Tue, 10 Jun 2025 14:33:20 +0200
Subject: [PATCH] [HLSL][SPIR-V] Change SPV AS map for groupshare
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/141759
From 84fd2cd7f42a3087b3807628d020189bf8b3cc17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Mon, 5 May 2025 18:01:17 +0200
Subject: [PATCH 1/7] [HLSL][SPIR-V] Handle SV_Postion builtin in
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/141759
From 84fd2cd7f42a3087b3807628d020189bf8b3cc17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Mon, 5 May 2025 18:01:17 +0200
Subject: [PATCH 1/7] [HLSL][SPIR-V] Handle SV_Postion builtin in
https://github.com/Keenuts 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
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/143519
From 9eb9d28d844e4427da5c9cc4f13b9263aae48ece Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Tue, 10 Jun 2025 14:33:20 +0200
Subject: [PATCH] [HLSL][SPIR-V] Change SPV AS map for groupshare
https://github.com/Keenuts approved this pull request.
a nit, otherwise LGTM
https://github.com/llvm/llvm-project/pull/143384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts edited
https://github.com/llvm/llvm-project/pull/143384
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1596,28 +1596,26 @@ Compilation *Driver::BuildCompilation(ArrayRef ArgList) {
A->claim();
if (Args.hasArg(options::OPT_spirv)) {
+const llvm::StringMap ValidTargets = {
+{"vulkan1.2", llvm::Triple::SPIRVSubArch_v15},
+{"vulkan1.3
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/141759
From 84fd2cd7f42a3087b3807628d020189bf8b3cc17 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Mon, 5 May 2025 18:01:17 +0200
Subject: [PATCH 1/6] [HLSL][SPIR-V] Handle SV_Postion builtin in
@@ -1147,6 +1154,26 @@ void SemaHLSL::handleSV_DispatchThreadIDAttr(Decl *D,
const ParsedAttr &AL) {
HLSLSV_DispatchThreadIDAttr(getASTContext(), AL));
}
+bool SemaHLSL::diagnosePositionType(QualType T, const ParsedAttr &AL) {
+ const auto *VT = T->getAs();
@@ -764,6 +764,13 @@ void SemaHLSL::CheckSemanticAnnotation(
return;
DiagnoseAttrStageMismatch(AnnotationAttr, ST, {llvm::Triple::Compute});
break;
+ case attr::HLSLSV_Position:
+// TODO: allow use on other shader types & output once the overall semantic
https://github.com/Keenuts closed
https://github.com/llvm/llvm-project/pull/143127
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -407,6 +429,13 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<>
&B,
llvm::Function *GroupIDIntrinsic = CGM.getIntrinsic(getGroupIdIntrinsic());
return buildVectorInput(B, GroupIDIntrinsic, Ty);
}
+ if (D.hasAttr()) {
+if (getArch() == llvm::Triple
@@ -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
https://github.com/Keenuts approved this pull request.
LGTM, just a small cleanup to do
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
https://github.com/Keenuts 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
@@ -4909,6 +4909,12 @@ def HLSLWaveReadLaneAt : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLWaveGetLaneCount : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_wave_get_lane_count"];
+ let Attributes = [NoThrow, Const];
+ let Prototype
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/143127
From d47adb2f82940abcab87428f7ef09b326bfb42e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Fri, 6 Jun 2025 14:00:49 +0200
Subject: [PATCH 1/2] [HLSL] Add WaveGetLaneCount() intrinsic to F
@@ -2350,6 +2350,10 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_is_first_lane)
__attribute__((convergent)) bool WaveIsFirstLane();
+_HLSL_AVAILABILITY(shadermodel, 6.0)
+_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_get_lane_count)
+__attribute__(
@@ -691,6 +691,11 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned
BuiltinID,
return EmitRuntimeCall(
Intrinsic::getOrInsertDeclaration(&CGM.getModule(), ID));
}
+ case Builtin::BI__builtin_hlsl_wave_get_lane_count: {
+Intrinsic::ID ID = CGM.getHLSLRu
@@ -4909,6 +4909,12 @@ def HLSLWaveReadLaneAt : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLWaveGetLaneCount : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_wave_get_lane_count"];
+ let Attributes = [NoThrow, Const];
+ let Prototype
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/143127
This commit adds code to lower WaveGetLaneCount() into the SPV or DXIL
intrinsic. The backends will then need to lower the intrinsic into proper
SPIR-V/DXIL.
Related to #99159
From d47adb2f82940abcab87428f7ef
https://github.com/Keenuts 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
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/141759
From 4653aca0444c9ce14893e877eeb88241c9b01934 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Mon, 5 May 2025 18:01:17 +0200
Subject: [PATCH] [HLSL][SPIR-V] Handle SV_Postion builtin in PS
https://github.com/Keenuts closed
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
Keenuts wrote:
There is one failure on the CI, in lldb, an unrelated timeout
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
@@ -140,6 +140,11 @@ def SharedVar : SubsetSubjecthasGlobalStorage() && !S->getTLSKind()}],
"global variables">;
+def HLSLInputBuiltin : SubsetSubjecthasGlobalStorage() &&
+S->getStorageClass()==StorageClass::SC_Static &&
+
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/138530
From 8c405fefdb31200930b9a690df635aff7775f602 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Wed, 30 Apr 2025 11:06:55 +0200
Subject: [PATCH 1/8] [HLSL] Implement vk::ext_builtin_input attr
@@ -554,6 +554,19 @@ static void initializeBufferFromBinding(CodeGenModule &CGM,
Args);
}
+void CGHLSLRuntime::handleGlobalVarDefinition(const VarDecl *VD,
+ llvm::GlobalVariable *GV) {
+ if (auto Attr = VD->getA
https://github.com/Keenuts edited
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
Keenuts wrote:
Hi, I don't think there is an issue with only emitting the `__spirv__` macro
with HLSL. Sent out https://github.com/llvm/llvm-project/pull/142401
https://github.com/llvm/llvm-project/pull/132848
___
cfe-commits mailing list
cfe-commits@
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/142401
OpenCL translator had a __spirv namespace, and defining the __spirv__ macro
causes issues downstream on the OpenCL side. This macro is needed to keep
compatibility with HLSL/DXC, but can be avoided for other ta
https://github.com/Keenuts approved this pull request.
https://github.com/llvm/llvm-project/pull/141954
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts closed
https://github.com/llvm/llvm-project/pull/141954
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Keenuts wrote:
thanks!
https://github.com/llvm/llvm-project/pull/141954
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/141759
From 085154ddedf3b0789a3908231d04f997e9e66ac4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Wed, 30 Apr 2025 11:06:55 +0200
Subject: [PATCH 1/8] [HLSL] Implement vk::ext_builtin_input attr
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/141759
From 085154ddedf3b0789a3908231d04f997e9e66ac4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Wed, 30 Apr 2025 11:06:55 +0200
Subject: [PATCH 1/8] [HLSL] Implement vk::ext_builtin_input attr
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/141759
This PR goes on top of #138530
This commit is using the same mechanism as vk::ext_builtin_input to
implement the SV_Position semantic input.
The HLSL signature is not yet ready for DXIL, hence this commit only
i
https://github.com/Keenuts approved this pull request.
https://github.com/llvm/llvm-project/pull/137805
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Keenuts wrote:
@llvm-beanz are you OK with the HLSL-side of the change?
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
Keenuts wrote:
Rebased, tests not pass (HLSL, and locally for the rest). The CI is quite busy
today so the rest is still pending.
Adding more reviewers for the final round
@llvm-beanz for the Microsoft side
@arsenm for the AMDGPU address space bit
https://github.com/llvm/llvm-project/pull/138
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/138530
From 085154ddedf3b0789a3908231d04f997e9e66ac4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Wed, 30 Apr 2025 11:06:55 +0200
Subject: [PATCH 1/7] [HLSL] Implement vk::ext_builtin_input attr
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/138530
From 04cabdd5cb1400ea6fe4e92cf99a44e3004f04c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Wed, 30 Apr 2025 11:06:55 +0200
Subject: [PATCH 1/7] [HLSL] Implement vk::ext_builtin_input attr
Keenuts wrote:
Regarding the HLSL tests:
I cannot reproduce the broken test on my branch (the file was not in main yet),
so seems like the HLSL test is pulling main and doing something different.
Rebased on main and the test passes locally, weird.
https://github.com/llvm/llvm-project/pull/13853
Keenuts wrote:
Yes, I need to
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
@@ -5759,9 +5761,18 @@ void CodeGenModule::EmitGlobalVarDefinition(const
VarDecl *D,
getCUDARuntime().internalizeDeviceSideVar(D, Linkage);
}
getCUDARuntime().handleVarRegistration(D, *GV);
+ } else if (LangOpts.HLSL &&
+ GetGlobalVarAddressSpace(D)
@@ -5636,6 +5636,8 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl
*D,
Init = llvm::UndefValue::get(getTypes().ConvertTypeForMem(ASTTy));
else if (D->hasAttr())
Init = llvm::UndefValue::get(getTypes().ConvertTypeForMem(ASTTy));
+ else if (GetGlobalVarAd
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/138530
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-s
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/138530
From 8971ce70badbf1a7bdbe04f4ba94b03b56adacf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Wed, 30 Apr 2025 11:06:55 +0200
Subject: [PATCH 1/4] [HLSL] Implement vk::ext_builtin_input attr
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/138530
From 8971ce70badbf1a7bdbe04f4ba94b03b56adacf5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Wed, 30 Apr 2025 11:06:55 +0200
Subject: [PATCH 1/2] [HLSL] Implement vk::ext_builtin_input attr
Keenuts wrote:
Adding Steven for an initial review before bothering more people
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
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/138530
This variable attribute is used in HLSL to add Vulkan specific builtins in a
shader.
The attribute is documented here:
https://github.com/microsoft/hlsl-specs/blob/17727e88fd1cb09013cb3a144110826af05f4dd5/propos
https://github.com/Keenuts approved this pull request.
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
Keenuts wrote:
Closed in favor of https://github.com/llvm/llvm-project/pull/135794
https://github.com/llvm/llvm-project/pull/134844
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts closed
https://github.com/llvm/llvm-project/pull/134844
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts approved this pull request.
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
@@ -6888,6 +6888,42 @@ static void SetNestedNameSpecifier(Sema &S,
DeclaratorDecl *DD, Declarator &D) {
DD->setQualifierInfo(SS.getWithLocInContext(S.Context));
}
+void Sema::deduceHLSLAddressSpace(VarDecl *Decl) {
+ // The variable already has an address space (groupshare
https://github.com/Keenuts closed
https://github.com/llvm/llvm-project/pull/133464
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/133464
From 12524667594d413c93a2c88a206a930cff638da3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Thu, 28 Nov 2024 15:00:56 +0100
Subject: [PATCH 1/5] [SPIR-V] Add hlsl_private address space for
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/133464
From 12524667594d413c93a2c88a206a930cff638da3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Thu, 28 Nov 2024 15:00:56 +0100
Subject: [PATCH 1/3] [SPIR-V] Add hlsl_private address space for
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/133464
From 12524667594d413c93a2c88a206a930cff638da3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Thu, 28 Nov 2024 15:00:56 +0100
Subject: [PATCH 1/6] [SPIR-V] Add hlsl_private address space for
https://github.com/Keenuts updated
https://github.com/llvm/llvm-project/pull/133464
From 12524667594d413c93a2c88a206a930cff638da3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nathan=20Gau=C3=ABr?=
Date: Thu, 28 Nov 2024 15:00:56 +0100
Subject: [PATCH 1/4] [SPIR-V] Add hlsl_private address space for
Keenuts wrote:
miss-typed enter, sent the comment above too early.
There are multiple ways to solve this issue:
- fix the FunctionAttr to run DCE again once the `convergent` attribute is
removed to make sure those invalid cases don't happen.
- fix the FunctionAttr to not remove `convergent` i
Keenuts wrote:
FYI: there is this PR which I think will replace this one:
https://github.com/llvm/llvm-project/pull/134863
> I didn't understand the validity part. Why is the caller required to be
> convergent in order to add a token to a callsite?
Given this example:
```llvm
declare i32 @fo
Keenuts wrote:
rebased on main, no change since the last review.
https://github.com/llvm/llvm-project/pull/133464
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Keenuts wrote:
> Turns out not really, I ran spec with this about 2 years ago and the only
> non-noise change was a mild improvement
Looking at the PR you linked, seems like there was still not a clear consensus
on the default change no? (And I'd assume consumers like llvm-translator won't
be
Keenuts wrote:
> These should not have side effects.
I agree I'm stretching the "hasSideEffect" definition here.
> Whatever is removing the convergent needs to consider the uses (or more
> likely, just leave it alone)
I suspect the long-term change to change the default IR to assume convergen
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/134844
When a callee is marked as `convergent`, some targets like HLSL/SPIR-V add a
convergent token to the call.
This is valid if both functions are marked as `convergent`.
ADCE/BDCE and other DCE passes were allowed
@@ -386,13 +386,29 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
if (ContainedTy.isNull())
return nullptr;
-assert(!ResAttrs.RawBuffer &&
- "Raw buffers handles are not implemented for SPIR-V yet");
assert(!ResAttrs.IsROV &&
@@ -711,13 +711,14 @@
BuiltinTypeDeclBuilder::addHandleAccessFunction(DeclarationName &Name,
using PH = BuiltinTypeMethodBuilder::PlaceHolder;
QualType ElemTy = getHandleElementType();
- // TODO: Map to an hlsl_device address space.
- QualType ElemPtrTy = AST.getPointer
@@ -386,13 +386,22 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
if (ContainedTy.isNull())
return nullptr;
-assert(!ResAttrs.RawBuffer &&
- "Raw buffers handles are not implemented for SPIR-V yet");
assert(!ResAttrs.IsROV &&
@@ -57,22 +58,37 @@ void main(unsigned GI : SV_GroupIndex) {
// CHECK: define void @main()
// CHECK-NEXT: entry:
// Verify destructor is emitted
-// NOINLINE-NEXT: call void @_GLOBAL__sub_I_GlobalDestructors.hlsl()
-// NOINLINE-NEXT: %0 = call i32 @llvm.dx.flattened.th
https://github.com/Keenuts edited
https://github.com/llvm/llvm-project/pull/133468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -386,13 +386,22 @@ llvm::Type *CommonSPIRTargetCodeGenInfo::getHLSLType(
if (ContainedTy.isNull())
return nullptr;
-assert(!ResAttrs.RawBuffer &&
- "Raw buffers handles are not implemented for SPIR-V yet");
assert(!ResAttrs.IsROV &&
https://github.com/Keenuts approved this pull request.
minor comments, otherwise OK
https://github.com/llvm/llvm-project/pull/133468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Keenuts created
https://github.com/llvm/llvm-project/pull/133469
Destructor calls were emitted without convergence
intrinsics when building for SPIR-V, which means invalid IR since we mixed
controlled and non-controlled convergence.
From 339d410e981b5172c57d9802e0a0fcc117575
1 - 100 of 315 matches
Mail list logo