[clang] [HLSL] Add resource name argument to resource class constructors (PR #139985)

2025-05-19 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/139985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Test cleanup - remove function attributes (PR #139302)

2025-05-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/139302 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Update Sema Checking Diagnostics for builtins (PR #138429)

2025-05-05 Thread Joshua Batista via cfe-commits
@@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only -disable-llvm-passes -verify -verify-ignore-unexpected +// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/136386 >From c1a89d6896edd29ff345dd8fdc30cd040f3760f3 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 18 Apr 2025 16:06:18 -0700 Subject: [PATCH 1/8] add md node type filter, and test --- .../test/CodeGenHL

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/136386 >From c1a89d6896edd29ff345dd8fdc30cd040f3760f3 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 18 Apr 2025 16:06:18 -0700 Subject: [PATCH 1/7] add md node type filter, and test --- .../test/CodeGenHL

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Joshua Batista via cfe-commits
bob80905 wrote: Created a new issue to improve range metadata validation here: https://github.com/llvm/llvm-project/issues/137407 https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/136386 >From c1a89d6896edd29ff345dd8fdc30cd040f3760f3 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 18 Apr 2025 16:06:18 -0700 Subject: [PATCH 1/6] add md node type filter, and test --- .../test/CodeGenHL

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Joshua Batista via cfe-commits
@@ -189,6 +189,26 @@ class DXILPrepareModule : public ModulePass { for (auto &BB : F) { IRBuilder<> Builder(&BB); for (auto &I : make_early_inc_range(BB)) { + + // TODO: Audit this list - is it enough? Too much? + static unsigned DXILComp

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/136386 >From c1a89d6896edd29ff345dd8fdc30cd040f3760f3 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 18 Apr 2025 16:06:18 -0700 Subject: [PATCH 1/5] add md node type filter, and test --- .../test/CodeGenHL

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-24 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/136386 >From c1a89d6896edd29ff345dd8fdc30cd040f3760f3 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 18 Apr 2025 16:06:18 -0700 Subject: [PATCH 1/4] add md node type filter, and test --- .../test/CodeGenHL

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-23 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/136386 >From c1a89d6896edd29ff345dd8fdc30cd040f3760f3 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 18 Apr 2025 16:06:18 -0700 Subject: [PATCH 1/3] add md node type filter, and test --- .../test/CodeGenHL

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-23 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/136386 >From c1a89d6896edd29ff345dd8fdc30cd040f3760f3 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 18 Apr 2025 16:06:18 -0700 Subject: [PATCH 1/2] add md node type filter, and test --- .../test/CodeGenHL

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

2025-04-21 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/135848 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/136386 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)

2025-04-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/136386 This PR introduces a Metadata Node Kind whitelist. The purpose is to prevent newer Metadata Node Kinds to be used and inserted into the outputted DXIL module. The Github DXC validator doesn't support these new

[clang] Reland "[HLSL][RootSignature] Define and integrate HLSLRootSignatureAttr" (PR #134293)

2025-04-16 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/134293 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

2025-04-16 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/135909 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

2025-04-16 Thread Joshua Batista via cfe-commits
bob80905 wrote: As a general comment, your approach of just checking for the existence of the binding attribute may not in itself be sufficient. Consider this PR: https://github.com/llvm/llvm-project/pull/135287/files There is a potential case where the binding attribute has a slot = -1, signif

[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

2025-04-16 Thread Joshua Batista via cfe-commits
@@ -14,6 +14,12 @@ RWBuffer c; // No warning - explicit binding. RWBuffer d : register(u0); +// No warning - explicit binding. +RWBuffer dd : register(space1); bob80905 wrote: Shouldn't there be a warning here? Though the space param is being explicitly bound

[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

2025-04-16 Thread Joshua Batista via cfe-commits
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD) { << static_cast(RT); } } + + if (!HasBinding && VD->getType()->isHLSLResourceRecord()) +SemaRef.Diag(VD->getLocation(), diag::warn_hlsl_implicit_binding); bob

[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

2025-04-16 Thread Joshua Batista via cfe-commits
@@ -1,12 +1,9 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \ -// RUN: -finclude-default-header -emit-pch -o %t %S/Inputs/pch.hlsl -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \ -// RUN: -finclude-default-header -include-pch %t -ast-

[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

2025-04-16 Thread Joshua Batista via cfe-commits
@@ -1,12 +1,9 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \ -// RUN: -finclude-default-header -emit-pch -o %t %S/Inputs/pch.hlsl -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \ -// RUN: -finclude-default-header -include-pch %t -ast-

[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

2025-04-16 Thread Joshua Batista via cfe-commits
@@ -1,13 +1,12 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -finclude-default-header -emit-pch -o %t %S/Inputs/pch_with_buf.hlsl -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \ -// RUN: -finclude-default-header -include-pch %t -ast-d

[clang] [HLSL][OpenCL] Strip addrspace from implicit cast diags (PR #135830)

2025-04-15 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/135830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][OpenCL] Strip addrspace from implicit cast diags (PR #135830)

2025-04-15 Thread Joshua Batista via cfe-commits
@@ -11360,6 +11360,14 @@ static void AnalyzeAssignment(Sema &S, BinaryOperator *E) { static void DiagnoseImpCast(Sema &S, Expr *E, QualType SourceType, QualType T, SourceLocation CContext, unsigned diag, bool pruneControl

[clang] [HLSL] Finish exposing half types and intrinsics always (PR #132804)

2025-04-05 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 commented: For example, for `abs`, it still depends on the _HLSL_16BIT_AVAILABILITY availability attribute. Does this PR intend to keep abs overloads using half "unexposed"? Or should that overload for abs be exposed too? https://github.com/llvm/llvm-project/pull/13

[clang] [HLSL] Finish exposing half types and intrinsics always (PR #132804)

2025-03-24 Thread Joshua Batista via cfe-commits
bob80905 wrote: > > > this is not NFC, so we should verify that we can call these intrinsics > > > with `half` values even if 16-bit types aren't enabled, and that they > > > properly codegen to 32-bit varia > > > > > > > > > > > For example, for `abs`, it still depends on the > > > > > > >

[clang] [HLSL] Finish exposing half types and intrinsics always (PR #132804)

2025-03-24 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. Talked offline, LGTM https://github.com/llvm/llvm-project/pull/132804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Finish exposing half types and intrinsics always (PR #132804)

2025-03-24 Thread Joshua Batista via cfe-commits
bob80905 wrote: > > > > For example, for `abs`, it still depends on the > > > > _HLSL_16BIT_AVAILABILITY availability attribute. Does this PR intend to > > > > keep abs overloads using half "unexposed"? Or should that overload for > > > > abs be exposed too? > > > > > > > > > Oh I see what y

[clang] [HLSL] Finish exposing half types and intrinsics always (PR #132804)

2025-03-24 Thread Joshua Batista via cfe-commits
bob80905 wrote: > > For example, for `abs`, it still depends on the _HLSL_16BIT_AVAILABILITY > > availability attribute. Does this PR intend to keep abs overloads using > > half "unexposed"? Or should that overload for abs be exposed too? > > Oh I see what you are referring to. That might be m

[clang] [HLSL][NFC] Refactor HLSLExternalSemaSource (PR #131032)

2025-03-24 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/131032 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement min and max overloads using templates (PR #131666)

2025-03-17 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. LGTM! Unfortunate about the macros not working out but this alternative is pretty convenient. https://github.com/llvm/llvm-project/pull/131666 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-15 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. Ok, given the specific conditions that: 1. there are 3 parameters 2. the first parameter should always be the vector type 3. and there should be at most one base type among all the parameters This macro should work for that specific case. I

[clang] [HLSL] Make sure `isSigned` flag is set on target type for `TypedBuffer` resources with signed int vectors (PR #130223)

2025-03-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. LGTM for DXIL. Is there a plan to do this with SPIR-V too? https://github.com/llvm/llvm-project/pull/130223 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[clang] [HLSL] Make sure `isSigned` flag is set on target type for `TypedBuffer` resources with signed int vectors (PR #130223)

2025-03-13 Thread Joshua Batista via cfe-commits
@@ -59,8 +59,14 @@ llvm::Type *DirectXTargetCodeGenInfo::getHLSLType( SmallVector Ints = {/*IsWriteable*/ ResAttrs.ResourceClass == llvm::dxil::ResourceClass::UAV, /*IsROV*/ ResAttrs.IsROV}; -

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-13 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/129939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-13 Thread Joshua Batista via cfe-commits
@@ -81,6 +93,9 @@ int64_t3 test_clamp_long3(int64_t3 p0, int64_t3 p1) { return clamp(p0, p1,p1); } // CHECK: define [[FNATTRS]] <4 x i64> @_Z16test_clamp_long4 // CHECK: call <4 x i64> @llvm.[[TARGET]].sclamp.v4i64 int64_t4 test_clamp_long4(int64_t4 p0, int64_t4 p1) { return c

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-13 Thread Joshua Batista via cfe-commits
@@ -94,6 +109,9 @@ uint64_t3 test_clamp_ulong3(uint64_t3 p0, uint64_t3 p1) { return clamp(p0, p1,p1 // CHECK: define [[FNATTRS]] <4 x i64> @_Z17test_clamp_ulong4 // CHECK: call <4 x i64> @llvm.[[TARGET]].uclamp.v4i64 uint64_t4 test_clamp_ulong4(uint64_t4 p0, uint64_t4 p1) { re

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-06 Thread Joshua Batista via cfe-commits
@@ -35,25 +35,48 @@ namespace hlsl { #define _HLSL_16BIT_AVAILABILITY_STAGE(environment, version, stage) #endif -#define GEN_VEC_SCALAR_OVERLOADS(FUNC_NAME, BASE_TYPE, AVAIL) \ - GEN_BOTH_OVERLOADS(FUNC_NAME, BASE_TYPE, BASE_TYPE##2, AVAIL) \

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-05 Thread Joshua Batista via cfe-commits
@@ -35,25 +35,48 @@ namespace hlsl { #define _HLSL_16BIT_AVAILABILITY_STAGE(environment, version, stage) #endif -#define GEN_VEC_SCALAR_OVERLOADS(FUNC_NAME, BASE_TYPE, AVAIL) \ - GEN_BOTH_OVERLOADS(FUNC_NAME, BASE_TYPE, BASE_TYPE##2, AVAIL) \

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-05 Thread Joshua Batista via cfe-commits
@@ -35,25 +35,48 @@ namespace hlsl { #define _HLSL_16BIT_AVAILABILITY_STAGE(environment, version, stage) #endif -#define GEN_VEC_SCALAR_OVERLOADS(FUNC_NAME, BASE_TYPE, AVAIL) \ - GEN_BOTH_OVERLOADS(FUNC_NAME, BASE_TYPE, BASE_TYPE##2, AVAIL) \

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-05 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/129939 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] add extra scalar vector overloads for clamp (PR #129939)

2025-03-05 Thread Joshua Batista via cfe-commits
@@ -35,25 +35,48 @@ namespace hlsl { #define _HLSL_16BIT_AVAILABILITY_STAGE(environment, version, stage) #endif -#define GEN_VEC_SCALAR_OVERLOADS(FUNC_NAME, BASE_TYPE, AVAIL) \ - GEN_BOTH_OVERLOADS(FUNC_NAME, BASE_TYPE, BASE_TYPE##2, AVAIL) \

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/129334 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. I can approve this, though it might be worth considering adding a macro at the top of hlsl_intrinsics.h, along with some of the other macros there, to shrink the change and possibly simplify future changes that need these types of sets of

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Joshua Batista via cfe-commits
@@ -131,3 +157,9 @@ double3 test_min_double3(double3 p0, double3 p1) { return min(p0, p1); } // CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double> @_Z16test_min_double4 // CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.minnum.v4f64 double4 test_min_dou

[clang] [HLSL] Add additional overloads for min and max to allow for mixed scalar and vector arguments (PR #129334)

2025-02-28 Thread Joshua Batista via cfe-commits
@@ -1678,6 +1678,30 @@ half3 max(half3, half3); _HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) _HLSL_BUILTIN_ALIAS(__builtin_elementwise_max) half4 max(half4, half4); +_HLSL_16BIT_AVAILABILITY(shadermodel, 6.2) +constexpr half2 max(half2 p0, half p1) { bob80905 wro

[clang] [HLSL] Add HLSLResourceBindingAttr to default constant buffer numeric declarations ($Globals) (PR #128981)

2025-02-27 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/128981 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add HLSLResourceBindingAttr to default constant buffer numeric declarations ($Globals) (PR #128981)

2025-02-27 Thread Joshua Batista via cfe-commits
@@ -1,41 +1,56 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -ast-dump -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -ast-dump -o - %s | FileCheck %s -// CHECK:HLSLBufferDecl 0x[[CB:[0-9a-f]+]

[clang] [HLSL] Add HLSLResourceBindingAttr to default constant buffer numeric declarations ($Globals) (PR #128981)

2025-02-27 Thread Joshua Batista via cfe-commits
@@ -1,41 +1,56 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -ast-dump -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -ast-dump -o - %s | FileCheck %s bob80905 wrote: Can you ex

[clang] [HLSL] Add HLSLResourceBindingAttr to default constant buffer numeric declarations ($Globals) (PR #128981)

2025-02-27 Thread Joshua Batista via cfe-commits
@@ -1,41 +1,56 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -ast-dump -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -ast-dump -o - %s | FileCheck %s -// CHECK:HLSLBufferDecl 0x[[CB:[0-9a-f]+]

[clang] [HLSL] Add HLSLResourceBindingAttr to default constant buffer numeric declarations ($Globals) (PR #128981)

2025-02-27 Thread Joshua Batista via cfe-commits
@@ -1,41 +1,56 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -ast-dump -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -ast-dump -o - %s | FileCheck %s -// CHECK:HLSLBufferDecl 0x[[CB:[0-9a-f]+]

[clang] [HLSL] Disallow virtual inheritance and functions (PR #127346)

2025-02-26 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/127346 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Implement Parsing of Descriptor Tables (PR #122982)

2025-02-26 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,375 @@ +//=== ParseHLSLRootSignatureTest.cpp - Parse Root Signature tests -===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. bob80905 wrote

[clang] [llvm] [HLSL] [DXIL] Implement the AddUint64 HLSL function and the UAddc DXIL op (PR #127137)

2025-02-14 Thread Joshua Batista via cfe-commits
@@ -2229,6 +2241,41 @@ static bool CheckResourceHandle( // returning an ExprError bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { switch (BuiltinID) { + case Builtin::BI__builtin_hlsl_adduint64: { +if (SemaRef.checkArgCount(TheCall, 2))

[clang] [HLSL] Update target test to use `-cc1` rather than the clang driver (PR #127262)

2025-02-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/127262 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Constant buffer layout struct update (PR #124840)

2025-02-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/124840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Constant buffer layout struct update (PR #124840)

2025-02-07 Thread Joshua Batista via cfe-commits
@@ -14183,6 +14183,7 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl) { if (getLangOpts().OpenCL && Var->getType().getAddressSpace() == LangAS::opencl_local) return; + bob80905 wrote: nit: unneeded new line https://github.com/llvm/llvm-p

[clang] [HLSL] Constant buffer layout struct update (PR #124840)

2025-02-07 Thread Joshua Batista via cfe-commits
@@ -48,94 +48,108 @@ struct TwoFloats { // CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer // CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer cbuffer CB { - // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_constant float' + // CHECK: VarDecl {{.*}} used a1 'hlsl_constant flo

[clang] [HLSL] Constant buffer layout struct update (PR #124840)

2025-02-07 Thread Joshua Batista via cfe-commits
@@ -48,94 +48,108 @@ struct TwoFloats { // CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer // CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer cbuffer CB { - // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_constant float' + // CHECK: VarDecl {{.*}} used a1 'hlsl_constant flo

[clang] [HLSL] Constant buffer layout struct update (PR #124840)

2025-02-07 Thread Joshua Batista via cfe-commits
@@ -472,14 +477,16 @@ void createHostLayoutStructForBuffer(Sema &S, HLSLBufferDecl *BufDecl) { IdentifierInfo *II = getHostLayoutStructName(S, BufDecl, true); CXXRecordDecl *LS = - CXXRecordDecl::Create(AST, TagDecl::TagKind::Class, BufDecl, + CXXRecordDecl::Cre

[clang] [HLSL] Constant buffer layout struct update (PR #124840)

2025-02-07 Thread Joshua Batista via cfe-commits
@@ -393,7 +396,7 @@ static FieldDecl *createFieldForHostLayoutStruct(Sema &S, const Type *Ty, auto *Field = FieldDecl::Create(AST, LayoutStruct, SourceLocation(), SourceLocation(), II, QT, TSI, nullptr, false,

[clang] [HLSL] Constant buffer layout struct update (PR #124840)

2025-02-07 Thread Joshua Batista via cfe-commits
@@ -48,94 +48,108 @@ struct TwoFloats { // CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer // CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer cbuffer CB { - // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_constant float' + // CHECK: VarDecl {{.*}} used a1 'hlsl_constant flo

[clang] [HLSL] Constant buffer layout struct update (PR #124840)

2025-02-07 Thread Joshua Batista via cfe-commits
@@ -48,94 +48,108 @@ struct TwoFloats { // CHECK: HLSLResourceClassAttr {{.*}} Implicit CBuffer // CHECK: HLSLResourceAttr {{.*}} Implicit CBuffer cbuffer CB { - // CHECK: VarDecl {{.*}} col:9 used a1 'hlsl_constant float' + // CHECK: VarDecl {{.*}} used a1 'hlsl_constant flo

[clang] [HLSL][NFC] Add test check to make sure the resource handle gets stored in the resource global (PR #124866)

2025-02-07 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/124866 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Fix typo in comment in SemaHLSL.cpp (PR #125992)

2025-02-05 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/125992 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Rename functions that collect resource bindings (PR #125904)

2025-02-05 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/125904 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] cbuffer: Create host layout structs (PR #122820)

2025-01-22 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/122820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement the HLSL distance intrinsic (PR #122357)

2025-01-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/122357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement the HLSL distance intrinsic (PR #122357)

2025-01-09 Thread Joshua Batista via cfe-commits
@@ -871,6 +871,34 @@ float3 degrees(float3); _HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_degrees) float4 degrees(float4); +//===--===// +// distance builtins +//===--

[clang] [HLSL] Implement the HLSL distance intrinsic (PR #122357)

2025-01-09 Thread Joshua Batista via cfe-commits
@@ -871,6 +871,34 @@ float3 degrees(float3); _HLSL_BUILTIN_ALIAS(__builtin_hlsl_elementwise_degrees) float4 degrees(float4); +//===--===// +// distance builtins +//===--

[clang] [HLSL][NFC] Move packoffset validation to separate function and calculate offsets in bytes (PR #121989)

2025-01-07 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/121989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][NFC] Move packoffset validation to separate function and calculate offsets in bytes (PR #121989)

2025-01-07 Thread Joshua Batista via cfe-commits
@@ -4721,9 +4721,9 @@ def HLSLPackOffset: HLSLAnnotationAttr { let Args = [IntArgument<"Subcomponent">, IntArgument<"Component">]; let Documentation = [HLSLPackOffsetDocs]; let AdditionalMembers = [{ - unsigned getOffset() { -return subcomponent * 4 + compone

[clang] [HLSL][NFC] Move packoffset validation to separate function and calculate offsets in bytes (PR #121989)

2025-01-07 Thread Joshua Batista via cfe-commits
@@ -194,17 +196,19 @@ static unsigned calculateLegacyCbufferSize(const ASTContext &Context, calculateLegacyCbufferSize(Context, VT->getElementType()); Size = ElementSize * ElementCount; } else { -Size = Context.getTypeSize(T); +Size = Context.getTypeSize(

[clang] [HLSL][NFC] Move packoffset validation to separate function and calculate offsets in bytes (PR #121989)

2025-01-07 Thread Joshua Batista via cfe-commits
@@ -219,33 +223,41 @@ void SemaHLSL::ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace) { } } - if (HasPackOffset && HasNonPackOffset) -Diag(BufDecl->getLocation(), diag::warn_hlsl_packoffset_mix); - - if (HasPackOffset) { -ASTContext &Context = getASTContext

[clang] [llvm] [NFC] fix up typos (PR #121842)

2025-01-06 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/121842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add concepts for Structured buffers (PR #119643)

2024-12-19 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/119643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add concepts for Structured buffers (PR #119643)

2024-12-19 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/119643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add concepts for Structured buffers (PR #119643)

2024-12-19 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,15 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl -ast-dump -ast-dump-filter=__is_structured_resource_element_compatible %s | FileCheck %s + +// CHECK: ConceptDecl 0x{{[0-9a-f]+}} <> __is_structured_resource_element_compatible +// CHECK: |-Temp

[clang] Add concepts for Structured buffers (PR #119643)

2024-12-19 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/119643 >From cbcdcd37ec82e7bbb5fdd1cf83b093778d4fcf9f Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 11 Dec 2024 17:02:02 -0800 Subject: [PATCH 1/7] add concepts for raw buffers --- clang/lib/Sema/HLSLExte

[clang] [llvm] [DirectX][SPIRV] Consistent names for HLSL resource intrinsics (PR #120466)

2024-12-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 approved this pull request. https://github.com/llvm/llvm-project/pull/120466 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add concepts for Structured buffers (PR #119643)

2024-12-16 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/119643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add concepts for Structured buffers (PR #119643)

2024-12-16 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/119643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add concepts for raw buffers (PR #119643)

2024-12-13 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/119643 >From cbcdcd37ec82e7bbb5fdd1cf83b093778d4fcf9f Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 11 Dec 2024 17:02:02 -0800 Subject: [PATCH 1/5] add concepts for raw buffers --- clang/lib/Sema/HLSLExte

[clang] Add concepts for raw buffers (PR #119643)

2024-12-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/119643 >From cbcdcd37ec82e7bbb5fdd1cf83b093778d4fcf9f Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 11 Dec 2024 17:02:02 -0800 Subject: [PATCH 1/4] add concepts for raw buffers --- clang/lib/Sema/HLSLExte

[clang] Add concepts for raw buffers (PR #119643)

2024-12-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 edited https://github.com/llvm/llvm-project/pull/119643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add concepts for raw buffers (PR #119643)

2024-12-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/119643 >From cbcdcd37ec82e7bbb5fdd1cf83b093778d4fcf9f Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 11 Dec 2024 17:02:02 -0800 Subject: [PATCH 1/3] add concepts for raw buffers --- clang/lib/Sema/HLSLExte

[clang] Add concepts for raw buffers (PR #119643)

2024-12-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/119643 >From cbcdcd37ec82e7bbb5fdd1cf83b093778d4fcf9f Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 11 Dec 2024 17:02:02 -0800 Subject: [PATCH 1/2] add concepts for raw buffers --- clang/lib/Sema/HLSLExte

[clang] Add concepts for raw buffers (PR #119643)

2024-12-11 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/119643 This PR adds concept validation to raw buffers like Structured buffers, in the same way that it was done for typed buffers in https://github.com/llvm/llvm-project/pull/116413. This PR should also be responsib

[clang] [NFC] Cleanup comments in HLSLExternalSemaSource.cpp (PR #119444)

2024-12-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/119444 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [NFC] Cleanup comments in HLSLExternalSemaSource.cpp (PR #119444)

2024-12-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/119444 Cleaning up some comments that @bogner pointed out were unpolished. >From 3a09b73239a4b14b8704d71ad5683abdf5ff8b08 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 10 Dec 2024 11:45:56 -0800 Subject: [

[clang] [NFC] Cleanup comments in HLSLExternalSemaSource.cpp (PR #119444)

2024-12-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/119444 >From 3a09b73239a4b14b8704d71ad5683abdf5ff8b08 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 10 Dec 2024 11:45:56 -0800 Subject: [PATCH 1/2] cleanup comments NFC --- clang/lib/Sema/HLSLExternalSema

[clang] [llvm] [HLSL] Add implicit resource element type concepts to AST (PR #116413)

2024-12-10 Thread Joshua Batista via cfe-commits
@@ -5720,8 +5720,7 @@ static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, case UTT_IsTypedResourceElementCompatible: assert(Self.getLangOpts().HLSL && "typed resource element compatible types are an HLSL-only feature"); -if (Self.RequireCompleteT

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 closed https://github.com/llvm/llvm-project/pull/115971 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/15] print struct body within target ext ty context --- ...

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/14] print struct body within target ext ty context --- ...

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/13] print struct body within target ext ty context --- ...

[clang] [llvm] [HLSL] Do not print details in IR for target extension types (PR #115971)

2024-12-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/115971 >From 7413ceb21a6e0ac9212ef6317763ee0eff559612 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 12 Nov 2024 16:44:00 -0800 Subject: [PATCH 01/12] print struct body within target ext ty context --- ...

  1   2   3   4   5   6   7   >