[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,188 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +#include "llvm/Support/raw_ostream.h" + +using namespace llvm::hlsl::rootsig; + +namespace clang { +namespace hlsl { + +static std::string FormatTokenKinds(ArrayRef Kinds) { + std::string TokenString; + llvm::

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,110 @@ +//===--- ParseHLSLRootSignature.h ---*- C++ -*-===// +// +// 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

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,110 @@ +//===--- ParseHLSLRootSignature.h ---*- C++ -*-===// +// +// 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

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,188 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +#include "llvm/Support/raw_ostream.h" + +using namespace llvm::hlsl::rootsig; + +namespace clang { +namespace hlsl { + +static std::string FormatTokenKinds(ArrayRef Kinds) { + std::string TokenString; + llvm::

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,188 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +#include "llvm/Support/raw_ostream.h" + +using namespace llvm::hlsl::rootsig; + +namespace clang { +namespace hlsl { + +static std::string FormatTokenKinds(ArrayRef Kinds) { + std::string TokenString; + llvm::

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,110 @@ +//===--- ParseHLSLRootSignature.h ---*- C++ -*-===// +// +// 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

[clang] [llvm] [HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses (PR #133302)

2025-03-27 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,188 @@ +#include "clang/Parse/ParseHLSLRootSignature.h" + +#include "llvm/Support/raw_ostream.h" + +using namespace llvm::hlsl::rootsig; + +namespace clang { +namespace hlsl { + +static std::string FormatTokenKinds(ArrayRef Kinds) { bogner wrote: You c

[clang] [HLSL][RootSignature] Make Root Signature lexer keywords case-insensitive (PR #132967)

2025-03-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/132967 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [IRBuilder] Add new overload for CreateIntrinsic (PR #131942)

2025-03-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/131942 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Fix codegen to support classes in `cbuffer` (PR #132828)

2025-03-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/132828 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Include SPIRV in LLVM_TARGETS_TO_BUILD in the HLSL cmake cache (PR #133287)

2025-04-07 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/133287 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-18 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/133800 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add infastructure to parse parameters (PR #133800)

2025-04-16 Thread Justin Bogner via cfe-commits
bogner wrote: I'm not entirely convinced the generic `ParsedParamState` is the right level of abstraction. In some ways the declarative nature is nice, but I think it's quite a bit more complex than a simple recursive descent here. Warning - lots of untested and never compiled code follows. C

[clang] [HLSL] Make it possible to assign an array from a cbuffer (PR #134174)

2025-04-18 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. The fact that we get memcpy here points out some of the issues we have with representing cbuffers - it would really be nicer if this ended up generating elementwise copies instead. However, I think fixing that is out of the scope of this ch

[clang] [llvm] [DirectX] add Function name to DiagnosticInfoUnsupported Msg in DXILOpLowering (PR #136234)

2025-04-19 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/136234 ___ 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 Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. Looks good 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 Justin Bogner via cfe-commits
https://github.com/bogner 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-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

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

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

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

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,29 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; Test that only metadata nodes that are valid in DXIL are allowed through + +target triple = "dxilv1.0-unknown-shadermodel6.0-compute" + +; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: non

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

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -176,6 +185,9 @@ class DXILPrepareModule : public ModulePass { VersionTuple ValVer = MetadataInfo.ValidatorVersion; bool SkipValidation = ValVer.getMajor() == 0 && ValVer.getMinor() == 0; +// construct whitelist of valid metadata node kinds bogn

[clang] [HLSL] Put tests for compatibility overloads for 'clamp', 'isinf', 'min', and 'max' in own files (PR #137004)

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137004 ___ 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 Justin Bogner via cfe-commits
https://github.com/bogner commented: Description / commit message needs to be updated to match how this ended up, but otherwise this is looking pretty good. A couple of minor comments inline. https://github.com/llvm/llvm-project/pull/136386 ___ cfe-co

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

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,39 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; This test tests the whitelist inside of DxilPrepare.cpp. +; It ensures that certain metadata nodes are removed that aren't +; in the whitelist, and that certain nodes may remain that +; are on the whitelist. + +

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -1,108 +1,160 @@ -// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK \ -// RUN: -DFNATTRS="noundef nofpclass(nan inf)"

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/137898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/137898 These tests had checks across multiple functions, because none of the hlsl header implementation functions were inlined. Switch the run lines to use -O1 instead of -disable-llvm-passes and rewrite the tests to a

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -106,3 +102,17 @@ float3 test_lerp_uint64_t3(uint64_t3 p0) { return lerp(p0, p0, p0); } // CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) // CHECK: ret <4 x floa

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -277,6 +277,12 @@ constexpr bool4 isinf(double4 V) { return isinf((float4)V); } // lerp builtins overloads //===--===// +template +constexpr __detail::enable_if_t<(N > 1 && N <= 4), vector> -

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/137877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/137877 >From a6c359a02712277ba2feab9e2f1be1caf8fa650e Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Tue, 29 Apr 2025 11:59:37 -0700 Subject: [PATCH] [HLSL] Overloads for `lerp` with a scalar weight This adds overl

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/137877 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-30 Thread Justin Bogner via cfe-commits
@@ -1,108 +1,160 @@ -// RUN: %clang_cc1 -std=hlsl202x -finclude-default-header -x hlsl -triple \ -// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \ -// RUN: -o - | FileCheck %s --check-prefixes=CHECK \ -// RUN: -DFNATTRS="noundef nofpclass(nan inf)"

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-30 Thread Justin Bogner via cfe-commits
bogner wrote: > I have a strong suspicion all the `*-overload.hlsl` tests have the same > mistake and are also incorrect and need to updated. Can you file a ticket for > investigating\cleaning up the other overload tests. Not work you have to do, > but we should at least track that it needs ot

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/137898 Rate limit ยท GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-se

[clang] [HLSL] Make lerp overload tests stricter. NFC (PR #137898)

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/137898 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-30 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -106,3 +102,17 @@ float3 test_lerp_uint64_t3(uint64_t3 p0) { return lerp(p0, p0, p0); } // CHECK: %hlsl.lerp = call reassoc nnan ninf nsz arcp afn <4 x float> @llvm.[[TARGET]].lerp.v4f32(<4 x float> %{{.*}}, <4 x float> %{{.*}}, <4 x float> %{{.*}}) // CHECK: ret <4 x floa

[clang] [llvm] [DirectX] Use scalar arguments for @llvm.dx.dot intrinsics (PR #134570)

2025-04-14 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/134570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Don't invoke `dxv` from `clang-dxc` for text output (PR #135876)

2025-04-16 Thread Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/135876 >From de6d197193e758d649cbebe6d96cd8e5af95d9ac Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Tue, 15 Apr 2025 15:05:21 -0700 Subject: [PATCH 1/2] [HLSL] Don't invoke `dxv` from `clang-dxc` for text output

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

2025-04-16 Thread Justin Bogner 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); bog

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

2025-04-17 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed 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 Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/135909 >From cabe20bfd129a574f978c2a10e4f66a04cb85794 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 2 Apr 2025 11:34:00 -0700 Subject: [PATCH 1/6] [HLSL] Add a warning for implicit bindings Implicit bindings

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

2025-04-16 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -Wno-error=hlsl-implicit-binding -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// expected-warning@+1 {{resource has implicit register binding}} +cbuffer cb0 { + int a; +} + +// No warning - this is an elemen

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

2025-04-16 Thread Justin Bogner 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); bogner wrote: Yes, you're correct. I've updated the latest, though this is commented out now becau

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

2025-04-16 Thread Justin Bogner via cfe-commits
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD) { << static_cast(RT); } } + + if (!HasBinding && VD->getType()->isHLSLResourceRecord()) bogner wrote: Good catch! Added some tests with arrays and updated this to

[clang] [HLSL] Don't invoke `dxv` from `clang-dxc` for text output (PR #135876)

2025-04-16 Thread Justin Bogner via cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/135876 ___ 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 Justin Bogner via cfe-commits
https://github.com/bogner updated https://github.com/llvm/llvm-project/pull/135909 >From cabe20bfd129a574f978c2a10e4f66a04cb85794 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Wed, 2 Apr 2025 11:34:00 -0700 Subject: [PATCH 1/2] [HLSL] Add a warning for implicit bindings Implicit bindings

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

2025-04-16 Thread Justin Bogner via cfe-commits
bogner 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,

[clang] [llvm] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)

2025-04-23 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/136747 ___ 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 Justin Bogner via cfe-commits
https://github.com/bogner 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 Justin Bogner via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +source_filename = "C:\\Users\\jbatista\\Desktop\\particle_life.hlsl" +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxilv1.0-unknown-shader

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

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -161,6 +161,15 @@ class DXILPrepareModule : public ModulePass { Builder.getPtrTy(PtrTy->getAddressSpace(; } + static llvm::SmallVector getCompatibleInstructionMDs(Module &M) { +llvm::SmallVector ret = { bogner wrote: Bet

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

2025-04-25 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: This looks pretty good, but the test needs to also cover the positive cases. We should show that dx.nonuniform and MD_range, for example, are *not* removed. This can probably be done in the same test file unless you think it's worthwhile to split it up. ht

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

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +source_filename = "C:\\Users\\jbatista\\Desktop\\particle_life.hlsl" +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxilv1.0-unknown-shader

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

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +source_filename = "C:\\Users\\jbatista\\Desktop\\particle_life.hlsl" +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxilv1.0-unknown-shader

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

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +source_filename = "C:\\Users\\jbatista\\Desktop\\particle_life.hlsl" +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxilv1.0-unknown-shader

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

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +source_filename = "C:\\Users\\jbatista\\Desktop\\particle_life.hlsl" +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxilv1.0-unknown-shader

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

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,80 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +source_filename = "C:\\Users\\jbatista\\Desktop\\particle_life.hlsl" +target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64" +target triple = "dxilv1.0-unknown-shader

[clang] [HLSL] Treat classes and structs as packed by default (PR #137391)

2025-04-25 Thread Justin Bogner via cfe-commits
bogner wrote: > Are there offload test suite tests to go with this? https://github.com/llvm-beanz/offload-test-suite/pull/83 https://github.com/llvm/llvm-project/pull/137391 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.or

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

2025-04-25 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,39 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; This test tests the whitelist inside of DxilPrepare.cpp. +; It ensures that certain metadata nodes are removed that aren't +; in the whitelist, and that certain nodes may remain that +; are on the whitelist. ---

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

2025-04-25 Thread Justin Bogner via cfe-commits
https://github.com/bogner 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 Justin Bogner via cfe-commits
@@ -0,0 +1,39 @@ +; RUN: opt -S --dxil-prepare %s | FileCheck %s + +; This test tests the whitelist inside of DxilPrepare.cpp. +; It ensures that certain metadata nodes are removed that aren't +; in the whitelist, and that certain nodes may remain that +; are on the whitelist. + +

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

2025-04-15 Thread Justin Bogner 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][OpenCL] Strip addrspace from implicit cast diags (PR #135830)

2025-04-15 Thread Justin Bogner via cfe-commits
https://github.com/bogner 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] Don't invoke `dxv` from `clang-dxc` for text output (PR #135876)

2025-04-15 Thread Justin Bogner via cfe-commits
@@ -309,6 +309,9 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch, } bool HLSLToolChain::requiresValidation(DerivedArgList &Args) const { + if (!Args.hasArg(options::OPT_dxc_Fo)) +return false; bogner wrote: I'm not sure I

[clang] [HLSL] Don't invoke `dxv` from `clang-dxc` for text output (PR #135876)

2025-04-15 Thread Justin Bogner via cfe-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/135876 Running `clang-dxc` with textual output was emitting various spurious warnings (if `dxv` wasn't on your path) or errors (if it was). Avoid these by not attempting to run this tool when it doesn't make sense to d

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

2025-04-28 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137378 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-28 Thread Justin Bogner via cfe-commits
@@ -189,6 +201,9 @@ class DXILPrepareModule : public ModulePass { for (auto &BB : F) { IRBuilder<> Builder(&BB); for (auto &I : make_early_inc_range(BB)) { + + I.dropUnknownNonDebugMetadata(DXILCompatibleMDs); + if (I.getOpcode() == Ins

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: A minor comment on naming of the builtins but this generally looks good https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -1,34 +1,117 @@ -// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL +// RUN: %clang_cc1 -Wno-hlsl-implicit-binding -triple dxil-pc-shadermodel6.3-library -emit-llvm -disabl

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -4801,6 +4801,18 @@ def HLSLResourceGetPointer : LangBuiltin<"HLSL_LANG"> { let Prototype = "void(...)"; } +def HLSLResourceCreatePoisonHandle : LangBuiltin<"HLSL_LANG"> { + let Spellings = ["__builtin_hlsl_resource_createpoisonhandle"]; + let Attributes = [NoThrow]; +

[clang] [HLSL] Overloads for `lerp` with a scalar weight (PR #137877)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner created https://github.com/llvm/llvm-project/pull/137877 This adds overloads for the `lerp` function that accept a scalar for the weight parameter by splatting it into the appropriate vector. Fixes #137827 >From 64cc675721623a793d06a1208089dc9431409835 Mon Sep 17 00:

[clang] [HLSL] Resource initialization by constructors (PR #135120)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/135120 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][RootSignature] Add lexing support for floating points (PR #137720)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137720 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/137690 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: A couple of minor comments. The direction seems reasonable to me, but it'd be good to get someone more familiar with the Parser and AST to weigh in. https://github.com/llvm/llvm-project/pull/137690 ___ cfe-commits

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -5209,6 +5211,92 @@ void Parser::ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs) { } } +void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) { + assert(Tok.is(tok::identifier) && "Not a Microsoft attribute list"); + IdentifierInfo *R

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -5209,6 +5211,92 @@ void Parser::ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs) { } } +void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) { + assert(Tok.is(tok::identifier) && "Not a Microsoft attribute list"); + IdentifierInfo *R

[clang] [HLSL][RootSignature] Define and integrate rootsig clang attr and decl (PR #137690)

2025-04-29 Thread Justin Bogner via cfe-commits
@@ -5209,6 +5211,92 @@ void Parser::ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs) { } } +void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) { + assert(Tok.is(tok::identifier) && "Not a Microsoft attribute list"); + IdentifierInfo *R

[clang] [llvm] [DirectX] add Function name to DiagnosticInfoUnsupported Msg in DXILOpLowering (PR #136234)

2025-04-18 Thread Justin Bogner via cfe-commits
bogner wrote: This doesn't seem right. Are we just misusing `DiagnosticInfoUnsupported` here? The `Function` argument for `DiagnosticInfoWithLocationBase` is clearly meant to be part of the location (as evidenced by the "in function XYZ" part of the message). I suspect that we should really be

[clang] [llvm] [DirectX] add Function name to DiagnosticInfoUnsupported Msg in DXILOpLowering (PR #136234)

2025-04-18 Thread Justin Bogner via cfe-commits
@@ -139,7 +139,7 @@ class DiagnosticInfo { using DiagnosticHandlerFunction = std::function; class DiagnosticInfoGeneric : public DiagnosticInfo { - const Twine &MsgStr; + const Twine MsgStr; bogner wrote: All of the Twine usage in Diagnostic info is super s

[clang] [llvm] [DirectX] add Function name to DiagnosticInfoUnsupported Msg in DXILOpLowering (PR #136234)

2025-04-18 Thread Justin Bogner via cfe-commits
@@ -756,9 +756,10 @@ class OpLowerer { case Intrinsic::not_intrinsic: continue; default: { -DiagnosticInfoUnsupported Diag( -F, "Unsupported intrinsic for DXIL lowering"); -M.getContext().diagnose(Diag); +std::string Msg =

[clang] [llvm] [DirectX] add Function name to DiagnosticInfoUnsupported Msg in DXILOpLowering (PR #136234)

2025-04-18 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,7 @@ +// RUN: %if clang-dxc %{not %clang_dxc -T lib_6_3 %s 2>&1 | FileCheck %s %} bogner wrote: I don't think there's a `clang-dxc` feature, so I suspect this just never runs at all. This will fail if the DirectX backend isn't available, so I don't th

[clang] [HLSL] Reland; Make it possible to assign an array from a cbuffer (PR #136580)

2025-04-21 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/136580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HLSL][RootSignature] Add parsing for empty RootConstants (PR #137999)

2025-05-07 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/137999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-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

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-commits
https://github.com/bogner commented: This is looking pretty good, though I have some misgivings about `CommonHLSLTargetCodeGenInfo` and think it might be better to introduce a `HLSLLayoutBuilder` that can be used by targets as necessary instead. If you take that suggestion a couple of my comme

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/124886 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-commits
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() { return CGM.getTarget().getTriple().getArch(); } -void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) { - if (D->getStorageClass() == SC_Static) { -// For static inside cbuffer, take as global st

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-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

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-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");

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-commits
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() { return CGM.getTarget().getTriple().getArch(); } -void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) { - if (D->getStorageClass() == SC_Static) { -// For static inside cbuffer, take as global st

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-commits
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() { return CGM.getTarget().getTriple().getArch(); } -void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) { - if (D->getStorageClass() == SC_Static) { -// For static inside cbuffer, take as global st

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-commits
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() { return CGM.getTarget().getTriple().getArch(); } -void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) { - if (D->getStorageClass() == SC_Static) { -// For static inside cbuffer, take as global st

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-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

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-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

[clang] [HLSL] Constant buffers codegen (PR #124886)

2025-02-18 Thread Justin Bogner via cfe-commits
@@ -115,48 +83,176 @@ llvm::Triple::ArchType CGHLSLRuntime::getArch() { return CGM.getTarget().getTriple().getArch(); } -void CGHLSLRuntime::addConstant(VarDecl *D, Buffer &CB) { - if (D->getStorageClass() == SC_Static) { -// For static inside cbuffer, take as global st

[clang] [HLSL] Bug fix crash using Array Parameters when De-sugaring is the same as canonicalizing (PR #127670)

2025-02-18 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. https://github.com/llvm/llvm-project/pull/127670 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    4   5   6   7   8   9   10   >