[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-13 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-13 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,126 @@ +; RUN: opt -S -disable-output -passes="print" < %s 2>&1 | FileCheck %s + +@G = external constant <4 x float>, align 4 + +define void @test_typedbuffer() { + ; RWBuffer Buf : register(u5, space3) + %typed0 = call target("dx.TypedBuffer", <4 x float>, 1, 0, 0)

[llvm-branch-commits] [DXIL][Analysis] Implement enough of DXILResourceAnalysis for buffers (PR #100699)

2024-08-13 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/100699 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Implement metadata lowering for resources (PR #104447)

2024-08-15 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/104447 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)

2024-08-15 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/104448 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)

2024-08-15 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/104448 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)

2024-08-15 Thread Helena Kotas via llvm-branch-commits
@@ -10,23 +10,235 @@ #include "DXILResourceAnalysis.h" #include "DirectX.h" #include "llvm/ADT/StringRef.h" +#include "llvm/Analysis/DXILResource.h" #include "llvm/IR/PassManager.h" +#include "llvm/InitializePasses.h" #include "llvm/Pass.h" +#include "llvm/Support/FormatAdapt

[llvm-branch-commits] [DirectX] Add resource handling to the DXIL pretty printer (PR #104448)

2024-08-15 Thread Helena Kotas via llvm-branch-commits
@@ -1,4 +1,13 @@ ; RUN: opt -S -passes=dxil-op-lower,dxil-translate-metadata %s | FileCheck %s +; RUN: opt -S -passes=dxil-pretty-printer %s 2>&1 >/dev/null | FileCheck --check-prefix=CHECK-PRETTY %s + +; CHECK-PRETTY: Type Format Dim ID HLSL Bind Co

[llvm-branch-commits] [DirectX] Move resource logic into PrettyPrinter and TranslateMetadata. NFC (PR #104446)

2024-08-15 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/104446 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Revert specialized createOp methods part of #101250 (PR #104245)

2024-08-15 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/104245 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Register a few DXIL passes with the new PM (PR #104250)

2024-08-15 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/104250 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-19 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,34 @@ +; We use llc for this test so that we don't abort after the first error. +; RUN: not llc %s -o /dev/null 2>&1 | FileCheck %s + +target triple = "dxil-pc-shadermodel6.6-compute" + +; CHECK: error: +; CHECK-SAME: in function storetoofew +; CHECK-SAME: typedBufferSt

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-08-19 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. https://github.com/llvm/llvm-project/pull/104253 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.handle.fromBinding` to DXIL ops (PR #104251)

2024-08-23 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/104251 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [DirectX] Lower `@llvm.dx.typedBufferStore` to DXIL ops (PR #104253)

2024-09-09 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. https://github.com/llvm/llvm-project/pull/104253 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.load.rawbuffer intrinsic (PR #121012)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/121012 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.store.rawbuffer intrinsic (PR #121282)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/121282 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.store.rawbuffer intrinsic (PR #121282)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
@@ -548,3 +550,85 @@ Examples: target("dx.TypedBuffer", f16, 1, 0) %buf, i32 %index, <4 x f16> %data) call void @llvm.dx.resource.store.typedbuffer.tdx.Buffer_v2f64_1_0_0t( target("dx.TypedBuffer", f64, 1, 0) %buf, i32 %index, <2 x f64> %data) + +For RawBuffer,

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.store.rawbuffer intrinsic (PR #121282)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
@@ -548,3 +550,85 @@ Examples: target("dx.TypedBuffer", f16, 1, 0) %buf, i32 %index, <4 x f16> %data) call void @llvm.dx.resource.store.typedbuffer.tdx.Buffer_v2f64_1_0_0t( target("dx.TypedBuffer", f64, 1, 0) %buf, i32 %index, <2 x f64> %data) + +For RawBuffer,

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.store.rawbuffer intrinsic (PR #121282)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
@@ -548,3 +550,85 @@ Examples: target("dx.TypedBuffer", f16, 1, 0) %buf, i32 %index, <4 x f16> %data) call void @llvm.dx.resource.store.typedbuffer.tdx.Buffer_v2f64_1_0_0t( target("dx.TypedBuffer", f64, 1, 0) %buf, i32 %index, <2 x f64> %data) + +For RawBuffer,

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.store.rawbuffer intrinsic (PR #121282)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
@@ -548,3 +550,85 @@ Examples: target("dx.TypedBuffer", f16, 1, 0) %buf, i32 %index, <4 x f16> %data) call void @llvm.dx.resource.store.typedbuffer.tdx.Buffer_v2f64_1_0_0t( target("dx.TypedBuffer", f64, 1, 0) %buf, i32 %index, <2 x f64> %data) + +For RawBuffer,

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.store.rawbuffer intrinsic (PR #121282)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota commented: LGTM! Just a few typos in the docs. https://github.com/llvm/llvm-project/pull/121282 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bran

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.load.rawbuffer intrinsic (PR #121012)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,232 @@ +; RUN: opt -S -dxil-op-lower %s | FileCheck %s + +target triple = "dxil-pc-shadermodel6.6-compute" + +declare void @f32_user(float) +declare void @v4f32_user(<4 x float>) +declare void @i32_user(i32) +declare void @v4i32_user(<4 x i32>) +declare void @v3f16_user

[llvm-branch-commits] [llvm] [DirectX] Implement the resource.load.rawbuffer intrinsic (PR #121012)

2025-01-06 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! Just one small test issue. https://github.com/llvm/llvm-project/pull/121012 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/124886 >From cf08adb6b9e181613e81d2cfbadbbb68e645fe33 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 28 Jan 2025 14:46:26 -0800 Subject: [PATCH 1/4] [HLSL] Translate cbuffer declarations to target type dx.CBuff

[llvm-branch-commits] [clang] [HLSL] Implement default constant buffer `$Globals` (PR #125807)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/125807 All variable declarations in the global scope that are not resources, static or empty are implicitly added to implicit constant buffer `$Globals`. Fixes #123801 Depends on #124886. >From 42bb34f66f0030f55e1055

[llvm-branch-commits] [clang] [HLSL] Implement default constant buffer `$Globals` (PR #125807)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/125807 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/124886 >From cf08adb6b9e181613e81d2cfbadbbb68e645fe33 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Tue, 28 Jan 2025 14:46:26 -0800 Subject: [PATCH 1/4] [HLSL] Translate cbuffer declarations to target type dx.CBuff

[llvm-branch-commits] [clang] [HLSL] Implement default constant buffer `$Globals` (PR #125807)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/125807 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-04 Thread Helena Kotas via llvm-branch-commits
@@ -5743,6 +5747,17 @@ HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext &C, SourceLocation(), SourceLocation()); } +const CXXRecordDecl *HLSLBufferDecl::getLayoutStruct() const { + // Layout struct is the last decl in the HLSL

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-05 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/123985 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-05 Thread Helena Kotas via llvm-branch-commits
@@ -647,6 +648,43 @@ void SemaHLSL::emitLogicalOperatorFixIt(Expr *LHS, Expr *RHS, << NewFnName << FixItHint::CreateReplacement(FullRange, OS.str()); } +void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) { + using namespace llvm::hlsl::root_signature

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-05 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -ast-dump \ +// RUN: -disable-llvm-passes -o - %s | FileCheck %s + +// This test ensures that the sample root signature is parsed without error and +// the Attr AST Node is created succesfully. If an inva

[llvm-branch-commits] [clang] [HLSL] Define the HLSLRootSignature Attr (PR #123985)

2025-02-05 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGMT! Couple of minor comments. https://github.com/llvm/llvm-project/pull/123985 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-10 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota converted_to_draft https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-01-31 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] TypedUAVLoadAdditionalFormats shader flag (PR #120280)

2024-12-17 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/120280 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Split resource info into type and binding info. NFC (PR #119773)

2024-12-14 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/119773 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Split resource info into type and binding info. NFC (PR #119773)

2024-12-14 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/119773 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Split resource info into type and binding info. NFC (PR #119773)

2024-12-14 Thread Helena Kotas via llvm-branch-commits
@@ -303,44 +289,157 @@ class ResourceInfo { dxil::SamplerFeedbackType getFeedbackType() const; uint32_t getMultiSampleCount() const; - StringRef getName() const { -// TODO: Get the name from the symbol once we include one here. -return ""; - } dxil::ResourceCl

[llvm-branch-commits] [llvm] [DirectX] Split resource info into type and binding info. NFC (PR #119773)

2024-12-14 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/119773 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Split resource info into type and binding info. NFC (PR #119773)

2024-12-14 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/119773 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [llvm] [DirectX] Create symbols for resource handles (PR #119775)

2024-12-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,48 @@ +; RUN: opt -S -passes=dxil-translate-metadata %s | FileCheck %s + +target triple = "dxil-pc-shadermodel6.6-compute" + +%struct.S = type { <4 x float>, <4 x i32> } + +define void @test() { + ; Buffer + %float4 = call target("dx.TypedBuffer", <4 x float>, 0, 0, 0

[llvm-branch-commits] [llvm] [DirectX] Create symbols for resource handles (PR #119775)

2024-12-14 Thread Helena Kotas via llvm-branch-commits
hekota wrote: If there already is a global variable for the resource in the module, shouldn't we be using that instead of creating a new symbol? https://github.com/llvm/llvm-project/pull/119775 ___ llvm-branch-commits mailing list llvm-branch-commit

[llvm-branch-commits] [llvm] [DirectX] Split resource info into type and binding info. NFC (PR #119773)

2024-12-13 Thread Helena Kotas via llvm-branch-commits
@@ -303,44 +289,157 @@ class ResourceInfo { dxil::SamplerFeedbackType getFeedbackType() const; uint32_t getMultiSampleCount() const; - StringRef getName() const { -// TODO: Get the name from the symbol once we include one here. -return ""; - } dxil::ResourceCl

[llvm-branch-commits] [llvm] [DirectX] Split resource info into type and binding info. NFC (PR #119773)

2024-12-13 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/119773 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Add RWBuffer::Load(Index) (PR #117018)

2024-11-22 Thread Helena Kotas via llvm-branch-commits
@@ -189,12 +189,28 @@ struct BuiltinTypeDeclBuilder { BuiltinTypeDeclBuilder &addArraySubscriptOperators(Sema &S) { if (Record->isCompleteDefinition()) return *this; -addArraySubscriptOperator(S, true); -addArraySubscriptOperator(S, false); +ASTContext &

[llvm-branch-commits] [clang] [HLSL] Add RWBuffer::Load(Index) (PR #117018)

2024-11-22 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/117018 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Add RWBuffer::Load(Index) (PR #117018)

2024-11-21 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/117018 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Add RWBuffer::Load(Index) (PR #117018)

2024-11-21 Thread Helena Kotas via llvm-branch-commits
@@ -189,12 +189,28 @@ struct BuiltinTypeDeclBuilder { BuiltinTypeDeclBuilder &addArraySubscriptOperators(Sema &S) { if (Record->isCompleteDefinition()) return *this; -addArraySubscriptOperator(S, true); -addArraySubscriptOperator(S, false); +ASTContext &

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-22 Thread Helena Kotas via llvm-branch-commits
@@ -1,16 +1,21 @@ // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s -// CHECK-DAG: @[[CB:.+]] = external constant { float } +// RUN: %clang_cc1 -finclude-default-header -triple

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-22 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/123411 >From 6aba475e4af789fc03594560ad9937e3502cce51 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 17 Jan 2025 13:31:01 -0800 Subject: [PATCH 1/3] [HLSL] Add address space `hlsl_constant(2)` for constant buff

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-22 Thread Helena Kotas via llvm-branch-commits
@@ -1,7 +1,14 @@ -// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s \ +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-21 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/123411 >From 6aba475e4af789fc03594560ad9937e3502cce51 Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Fri, 17 Jan 2025 13:31:01 -0800 Subject: [PATCH 1/2] [HLSL] Add address space `hlsl_constant(2)` for constant buff

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-21 Thread Helena Kotas via llvm-branch-commits
hekota wrote: I have added SPIR-V variants of the 3 codegen tests. https://github.com/llvm/llvm-project/pull/123411 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-21 Thread Helena Kotas via llvm-branch-commits
@@ -455,14 +456,22 @@ void createHostLayoutStructForBuffer(Sema &S, HLSLBufferDecl *BufDecl) { LS->setImplicit(true); LS->startDefinition(); - for (const Decl *D : BufDecl->decls()) { -const VarDecl *VD = dyn_cast(D); + for (Decl *D : BufDecl->decls()) { +VarDec

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-23 Thread Helena Kotas via llvm-branch-commits
@@ -1,16 +1,21 @@ // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library %s \ // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s -// CHECK-DAG: @[[CB:.+]] = external constant { float } +// RUN: %clang_cc1 -finclude-default-header -triple

[llvm-branch-commits] [clang] [HLSL] Add address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-17 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/123411 Introduces a new address space `hlsl_constant(2)` for constant buffer declarations. This address space is applied to declarations inside `cbuffer` block. Later on, it will also be applied to `ConstantBuffer` sy

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-17 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/123411 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-17 Thread Helena Kotas via llvm-branch-commits
@@ -100,22 +100,6 @@ GlobalVariable *replaceBuffer(CGHLSLRuntime::Buffer &Buf) { llvm::formatv("{0}{1}", Buf.Name, Buf.IsCBuffer ? ".cb." : ".tb."), GlobalValue::NotThreadLocal); - IRBuilder<> B(CBGV->getContext()); - Value *ZeroIdx = B.getInt32(0); - // Replace

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-17 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/123411 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-01-28 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/124886 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-21 Thread Helena Kotas via llvm-branch-commits
@@ -83,6 +83,7 @@ const LangASMap AMDGPUTargetInfo::AMDGPUDefIsPrivMap = { llvm::AMDGPUAS::FLAT_ADDRESS, // ptr32_uptr llvm::AMDGPUAS::FLAT_ADDRESS, // ptr64 llvm::AMDGPUAS::FLAT_ADDRESS, // hlsl_groupshared +llvm::AMDGPUAS::FLAT_ADDRESS, // hlsl_constant --

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-21 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/123411 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Introduce address space `hlsl_constant(2)` for constant buffer declarations (PR #123411)

2025-01-21 Thread Helena Kotas via llvm-branch-commits
@@ -42,6 +42,7 @@ static const unsigned DirectXAddrSpaceMap[] = { 0, // ptr32_uptr 0, // ptr64 3, // hlsl_groupshared +2, // hlsl_constant hekota wrote: Yes, not updating all of the maps produces a compile error. https://github.com/llvm/llvm-p

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -56,9 +75,18 @@ llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(CodeGenModule &CGM, return llvm::TargetExtType::get(Ctx, TypeName, {ElemType}, Ints); } - case llvm::dxil::ResourceClass::CBuffer: -llvm_unreachable("dx.CBuffer handles are not implemented yet");

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.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: Ap

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,201 @@ +//===- HLSLTargetInto.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: Ap

[llvm-branch-commits] [clang] [HLSL] Implement default constant buffer `$Globals` (PR #125807)

2025-02-14 Thread Helena Kotas via 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/4] [HLSL] Implement default constant buffer `$Globals` All variab

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,39 @@ +//===- HLSLTargetInfo.h ---===// +// +// 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: Apa

[llvm-branch-commits] [clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-14 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,49 @@ +; ModuleID = 'C:\llvm-project\clang\test\CodeGenHLSL\cbuffer_and_namespaces.hlsl' hekota wrote: This file should not be here at all ;). https://github.com/llvm/llvm-project/pull/124886 ___ llvm-bran

[llvm-branch-commits] [clang] [HLSL][NFC] Use builtin method builder to create default resource constructor (PR #131384)

2025-03-15 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/131384 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL][NFC] Use method builder to create default resource constructor (PR #131384)

2025-03-14 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/131384 Updates the `BuiltinTypeMethodBuilder` to support creating constructors and use it to create the default resource constructor. This enables us to have a shared code for implementing both builtin methods and cons

[llvm-branch-commits] [clang] [HLSL][NFC] Use builtin method builder to create default resource constructor (PR #131384)

2025-03-14 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/131384 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL][NFC] Use method builder to create default resource constructor (PR #131384)

2025-03-14 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/131384 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL][NFC] Use method builder to create default resource constructor (PR #131384)

2025-04-05 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/131384 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] DO NOT MERGE - Resource constructors prototype (PR #132453)

2025-03-26 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/132453 None >From 47b41c88a60a7f376070b9ff779ec955eebf523a Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Wed, 12 Mar 2025 17:20:51 -0700 Subject: [PATCH 1/3] [HLSL] Create default resource constructor with Builtin

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-11 Thread Helena Kotas via llvm-branch-commits
@@ -1529,72 +1529,80 @@ void SemaHLSL::handleResourceBindingAttr(Decl *TheDecl, const ParsedAttr &AL) { diag::err_incomplete_type)) return; } - StringRef Space = "space0"; + StringRef Slot = ""; + StringRef Space = ""; + Source

[llvm-branch-commits] [clang] [HLSL] DO NOT MERGE - Resource constructors prototype (PR #132453)

2025-04-11 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota closed https://github.com/llvm/llvm-project/pull/132453 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-11 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135287 >From 6fb658a603f116f29e635e4802a8d77b896150ff Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 10 Apr 2025 17:31:57 -0700 Subject: [PATCH 1/4] [HLSL] Allow register annotations to specify only `space` Spe

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-22 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135287 >From 6fb658a603f116f29e635e4802a8d77b896150ff Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 10 Apr 2025 17:31:57 -0700 Subject: [PATCH 1/5] [HLSL] Allow register annotations to specify only `space` Spe

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-23 Thread Helena Kotas via llvm-branch-commits
@@ -4723,20 +4723,25 @@ def HLSLResourceBinding: InheritableAttr { private: RegisterType RegType; - unsigned SlotNumber; + int SlotNumber; // -1 if the register slot was not specified hekota wrote: Good catch! DXC actually ignores the regist

[llvm-branch-commits] [llvm] [DirectX] Implementation of DXILResourceImplicitBinding pass (PR #138043)

2025-04-30 Thread Helena Kotas via llvm-branch-commits
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

[llvm-branch-commits] [llvm] [DirectX] Implement DXILResourceImplicitBinding pass (PR #138043)

2025-04-30 Thread Helena Kotas via llvm-branch-commits
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

[llvm-branch-commits] [llvm] [DirectX] Implement DXILResourceImplicitBinding pass (PR #138043)

2025-04-30 Thread Helena Kotas via llvm-branch-commits
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/2] [HLSL] Implementation of DXILResourceImplicitBinding pass Thi

[llvm-branch-commits] [llvm] [HLSL] Implementation of DXILResourceImplicitBinding pass (PR #138043)

2025-04-30 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/138043 The `DXILResourceImplicitBinding` pass uses the results of `DXILResourceBindingAnalysis` to assigns register slots to resources that do not have explicit binding. It replaces all `llvm.dx.resource.handlefromimp

[llvm-branch-commits] [llvm] [HLSL] Implementation of DXILResourceImplicitBinding pass (PR #138043)

2025-04-30 Thread Helena Kotas via llvm-branch-commits
@@ -0,0 +1,44 @@ +; RUN: opt -S -dxil-resource-implicit-binding %s | FileCheck %s hekota wrote: I just realized this test is not complete... working on a fix. https://github.com/llvm/llvm-project/pull/138043 ___ llvm-b

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-10 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135287 >From 6fb658a603f116f29e635e4802a8d77b896150ff Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 10 Apr 2025 17:31:57 -0700 Subject: [PATCH 1/3] [HLSL] Allow register annotations to specify only `space` Spe

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-10 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/135287 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-10 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota updated https://github.com/llvm/llvm-project/pull/135287 >From 6fb658a603f116f29e635e4802a8d77b896150ff Mon Sep 17 00:00:00 2001 From: Helena Kotas Date: Thu, 10 Apr 2025 17:31:57 -0700 Subject: [PATCH 1/2] [HLSL] Allow register annotations to specify only `space` Spe

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-10 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota created https://github.com/llvm/llvm-project/pull/135287 Specifying only `space` in a `register` annotation means the compiler should implicitly assign a register slot to the resource from the provided virtual register space. Fixes #133346 Depends on PR #135120 >

[llvm-branch-commits] [llvm] [DirectX] Implement DXILResourceImplicitBinding pass (PR #138043)

2025-05-06 Thread Helena Kotas via llvm-branch-commits
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/2] [HLSL] Implementation of DXILResourceImplicitBinding pass Thi

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-22 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/135287 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [llvm] [HLSL] Allow resource annotations to specify only register space (PR #135287)

2025-04-21 Thread Helena Kotas via llvm-branch-commits
@@ -163,11 +163,16 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs, SourceLocation SlotLoc = Tok.getLocation(); ArgExprs.push_back(ParseIdentifierLoc()); -// Add numeric_constant for fix-it. -if (SlotStr.size() == 1 && Tok.is(tok::numeric_constant)

[llvm-branch-commits] [clang] [HLSL] Implement default constant buffer `$Globals` (PR #125807)

2025-02-18 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota ready_for_review https://github.com/llvm/llvm-project/pull/125807 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [HLSL] Implement default constant buffer `$Globals` (PR #125807)

2025-02-18 Thread Helena Kotas via llvm-branch-commits
@@ -286,10 +286,7 @@ void CGHLSLRuntime::emitBufferGlobalsAndMetadata(const HLSLBufferDecl *BufDecl, .str( && "layout type does not match the converted element type"); -// there might be resources inside the used defined st

[llvm-branch-commits] [clang] [HLSL] Implement default constant buffer `$Globals` (PR #125807)

2025-02-18 Thread Helena Kotas via 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

[llvm-branch-commits] [clang] [HLSL] Implement default constant buffer `$Globals` (PR #125807)

2025-02-18 Thread Helena Kotas via llvm-branch-commits
https://github.com/hekota edited https://github.com/llvm/llvm-project/pull/125807 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

  1   2   >