[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] [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] 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] [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][NFC] Rename isImplicit() to hasRegisterStot() on HLSLResourceBindingAttr (PR #138964)

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

[clang] [HLSL][NFC] Stricter Overload Tests (clamp, max, min, pow) (PR #138993)

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

<    5   6   7   8   9   10