@@ -5753,6 +5765,30 @@ void HLSLBufferDecl::addLayoutStruct(CXXRecordDecl *LS) {
addDecl(LS);
}
+void HLSLBufferDecl::addDefaultBufferDecl(Decl *D) {
+ assert(isImplicit() &&
+ "default decls can only be added to the implicit/default constant "
+ "buffer $Gl
@@ -5072,6 +5080,20 @@ class HLSLBufferDecl final : public NamedDecl, public
DeclContext {
return static_cast(const_cast(DC));
}
+ // Iterator for the buffer decls. Concatenates the list of decls parented
hekota wrote:
That is correct. We are not depe
@@ -159,11 +159,16 @@ class SemaHLSL : public SemaBase {
// List of all resource bindings
ResourceBindings Bindings;
+ // default constant buffer $Globals
+ HLSLBufferDecl *DefaultCBuffer;
+
private:
void collectResourcesOnVarDecl(VarDecl *D);
void collectResource
@@ -179,21 +179,45 @@ createBufferHandleType(const HLSLBufferDecl *BufDecl) {
return cast(QT.getTypePtr());
}
+// Iterates over all declarations in the HLSL buffer and based on the
+// packoffset or register(c#) annotations it fills outs the Layout
+// vector with the user-s
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/130338
Fixes #114126
>From c574bedb001f61f4bcdbf00613eec932028cf392 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Fri, 7 Mar 2025 12:09:33 -0800
Subject: [PATCH] [HLSL] Remove old resource annotations
Fixes #11412
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/130323
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/130323
`DXILResourceMDAnalysis` gathers information about resources from obsolete
resource metadata annotations that are going to be removed in a follow-up PR.
Part 1/2 of #114126
>From 80765757f067527816c4c8b9d728169
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/130338
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota reopened
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -11,59 +11,9 @@
//===--===//
#include "llvm/Frontend/HLSL/HLSLResource.h"
-#include "llvm/IR/IRBuilder.h"
-#include "llvm/IR/Metadata.h"
using namespace llvm;
using namespace llvm::hlsl;
-GlobalVaria
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/130338
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -125,15 +125,6 @@ class CGHLSLRuntime {
// End of reserved area for HLSL intrinsic getters.
//===--===//
- struct BufferResBinding {
hekota wrote:
The register number and space are u
hekota wrote:
Reopening. I've accidentally deleted the pr branch this depends on and it
closed this PR.
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cg
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/130323
>From 80765757f067527816c4c8b9d728169568b04b7a Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Fri, 7 Mar 2025 10:40:20 -0800
Subject: [PATCH 1/2] [DirectX] Remove DXILResourceMDAnalysis
Part 1/2 of #114126
--
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/128991
>From e982a61657da5eb4c7f2618c95f0c6d3493cb854 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 26 Feb 2025 19:14:20 -0800
Subject: [PATCH 1/3] [HLSL] Implement explicit layout for default constant
buffer
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/128991
>From e982a61657da5eb4c7f2618c95f0c6d3493cb854 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 26 Feb 2025 19:14:20 -0800
Subject: [PATCH 1/2] [HLSL] Implement explicit layout for default constant
buffer
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/125807
>From 42bb34f66f0030f55e1055c4ee0b362511b7f45b Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Tue, 4 Feb 2025 22:01:49 -0800
Subject: [PATCH 1/5] [HLSL] Implement default constant buffer `$Globals`
All variab
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/128991
Fixes #123801
>From e982a61657da5eb4c7f2618c95f0c6d3493cb854 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 26 Feb 2025 19:14:20 -0800
Subject: [PATCH] [HLSL] Implement explicit layout for default consta
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -816,6 +822,19 @@ def CreateHandle : DXILOp<57, createHandle> {
let attributes = [Attributes];
}
+def CBufferLoadLegacy : DXILOp<59, cbufferLoadLegacy> {
+ let Doc = "reads from a TypedBuffer";
hekota wrote:
```suggestion
let Doc = "reads from a const
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/128699
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota approved this pull request.
LGTM! Just one copy-paste nit.
https://github.com/llvm/llvm-project/pull/128699
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinf
https://github.com/hekota approved this pull request.
https://github.com/llvm/llvm-project/pull/128698
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/128991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/139022
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-se
@@ -32,6 +32,6 @@ export float TestLoad() {
// CHECK: %[[PTR1:.*]] = call ptr
@llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer",
float, 1, 1) %{{[0-9]+}}, i32 %{{[0-9]+}})
// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
-// CHECK: declare i32
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/138976
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/139022
>From 8194951b52e024b78c7f148d65ce6c23b3fcf424 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 7 May 2025 21:05:39 -0700
Subject: [PATCH 1/4] [HLSL] Implicit binding for cbuffers
Constant buffers defined
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/138976
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-se
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/138976
>From dfce6ce8edc520251c0561cfd50cc6c11af46ecd Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 7 May 2025 14:43:27 -0700
Subject: [PATCH] [HLSL] Add resource constructor with implicit binding for
global r
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/139022
>From 8194951b52e024b78c7f148d65ce6c23b3fcf424 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 7 May 2025 21:05:39 -0700
Subject: [PATCH 1/6] [HLSL] Implicit binding for cbuffers
Constant buffers defined
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/139022
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/138976
Adds constructor for resources with implicit binding and applies it to all
resources without binding at the global scope.
Adds Clang builtin function `__builtin_hlsl_resource_handlefromimplicitbinding`
that gets
@@ -33,7 +33,7 @@ void SecondEntry() {}
// Verify the constructor is alwaysinline
// NOINLINE: ; Function Attrs: {{.*}}alwaysinline
-// NOINLINE-NEXT: define linkonce_odr void @_ZN4hlsl8RWBufferIfEC2Ev({{.*}}
[[CtorAttr:\#[0-9]+]]
+// NOINLINE-NEXT: define linkonce_odr void @
@@ -32,6 +32,6 @@ export float TestLoad() {
// CHECK: %[[PTR1:.*]] = call ptr
@llvm.dx.resource.getpointer.p0.tdx.RawBuffer_f32_1_1t(target("dx.RawBuffer",
float, 1, 1) %{{[0-9]+}}, i32 %{{[0-9]+}})
// CHECK: %[[VALUE1:.*]] = load float, ptr %[[PTR1]]
-// CHECK: declare i32
@@ -21,7 +21,7 @@ void InitBuf(RWBuffer buf) {
// CHECK-NEXT: br i1 [[Tmp3]]
// CHECK-NOT: _Init_thread_header
// CHECK: init.check:
-// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIiEC1Ev
+// CHECK-NEXT: call void @_ZN4hlsl8RWBufferIiEC1Ejijj
hekota wrote:
Same a
@@ -994,6 +994,61 @@ void DXILResourceBindingInfo::populate(Module &M,
DXILResourceTypeMap &DRTM) {
}
}
+// returns false if binding could not be found in given space
+bool DXILResourceBindingInfo::findAvailableBinding(dxil::ResourceClass RC,
+
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/138043
>From f58e2d5c079f31d7a4d99d481a569ad4c754c4e7 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 30 Apr 2025 15:08:04 -0700
Subject: [PATCH 1/3] [HLSL] Implementation of DXILResourceImplicitBinding pass
Thi
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/139022
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-se
@@ -0,0 +1,182 @@
+//===- DXILResourceImplicitBinding.cpp ---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apac
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/138043
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/139022
Rate limit · GitHub
body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe
UI,Helvetica,Arial,sans-se
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/140635
>From 0dc74a35fe2c774d8d3de847fe4272363b38ff85 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 19 May 2025 15:18:09 -0700
Subject: [PATCH 1/2] [DirectX] Use resource names in DXIL metadata pass
---
llvm/
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/140633
Gather resource names from `llvm.dx.resource.handlefrombinding` calls during
DXIL resource analysis and add them to ResourceMap.
Part 3/4 of llvm/llvm-project#105059
>From a73cdb9288a0f325d4c03a58daf6803e8d8d2d
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/139991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/139991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/139991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/140635
Use resource names gathered during the DXIL resource analysis when creating
DXIL resources metadata.
Part 4/4 of https://github.com/llvm/llvm-project/issues/105059
Closes #140529
Depends on #140633
>From 0d
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/140633
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/139991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/139991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/140633
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/140633
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/140633
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/139991
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/140633
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota ready_for_review
https://github.com/llvm/llvm-project/pull/140635
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/140635
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/140642
Closes #137868
Depends on #140633
>From 9ba94a335ffca203b7299f363ea8663a46d64bf8 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Mon, 19 May 2025 15:57:02 -0700
Subject: [PATCH] [DirectX] Improve error messa
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/140645
This change uses resource name during DXIL resource binding analysis to detect
when two (or more) resources have identical overlapping binding.
The DXIL resource analysis just detects that there is a problem wit
@@ -167,7 +167,6 @@ TEST_F(ResourceBindingAnalysisTest,
TestUnboundedAndOverlap) {
// StructuredBuffer C[] : register(t0, space2);
// StructuredBuffer D: register(t4, space2); /* overlapping */
StringRef Assembly = R"(
-%__cblayout_CB = type <{ i32 }>
--
@@ -50,15 +51,55 @@ static void reportInvalidDirection(Module &M,
DXILResourceMap &DRM) {
}
}
-} // namespace
+static void reportOverlappingError(Module &M, ResourceInfo R1,
+ ResourceInfo R2) {
+ SmallString<64> Message;
+ raw_svector_os
https://github.com/hekota closed
https://github.com/llvm/llvm-project/pull/140642
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota created
https://github.com/llvm/llvm-project/pull/140982
Adds reporting of overlapping binding errors to
`DXILPostOptimizationValidation` pass. Only runs when
`DXILResourceBindingAnalysis` detects there is an overlapping binding.
Fixes #110723
Depends on #140635, #1
https://github.com/hekota edited
https://github.com/llvm/llvm-project/pull/140982
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/140937
>From 3f882eb22c0035e5f9dfe7b7324fb44a7a66dea8 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 21 May 2025 09:18:02 -0700
Subject: [PATCH 1/4] [DirectX] Update resource type names in DXIL metadata to
incl
https://github.com/hekota updated
https://github.com/llvm/llvm-project/pull/140937
>From 3f882eb22c0035e5f9dfe7b7324fb44a7a66dea8 Mon Sep 17 00:00:00 2001
From: Helena Kotas
Date: Wed, 21 May 2025 09:18:02 -0700
Subject: [PATCH 1/3] [DirectX] Update resource type names in DXIL metadata to
incl
101 - 172 of 172 matches
Mail list logo