[clang-tools-extra] Fix Default Asset File locator for clang docs (PR #97505)

2024-07-08 Thread Joshua Batista via cfe-commits
@@ -44,7 +42,10 @@ foreach(f ${assets}) install(FILES ${asset_dir}/${f} DESTINATION "${CMAKE_INSTALL_DATADIR}/clang-doc" COMPONENT clang-doc) - copy_files_to_dst(${asset_dir} ${resource_dir} ${f}) + foreach(config ${CMAKE_CONFIGURATION_TYPES}) bob8

[clang] [llvm] Add length builtins and length HLSL function to DirectX Backend (PR #101256)

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

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/102683 This PR adds the normalize intrinsic and an HLSL function that uses it. The SPIRV backend is also implemented. Used https://github.com/llvm/llvm-project/pull/101256 as a reference, along with https://github.co

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102683 >From f604acbb260911be7eb25d927aa91dc5b2994e93 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 9 Aug 2024 10:48:10 -0700 Subject: [PATCH 1/5] suboptimal expansion of normalize done --- clang/include/

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102683 >From f604acbb260911be7eb25d927aa91dc5b2994e93 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 9 Aug 2024 10:48:10 -0700 Subject: [PATCH 1/6] suboptimal expansion of normalize done --- clang/include/

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102683 >From f604acbb260911be7eb25d927aa91dc5b2994e93 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 9 Aug 2024 10:48:10 -0700 Subject: [PATCH 1/7] suboptimal expansion of normalize done --- clang/include/

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-09 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102683 >From f604acbb260911be7eb25d927aa91dc5b2994e93 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 9 Aug 2024 10:48:10 -0700 Subject: [PATCH 1/8] suboptimal expansion of normalize done --- clang/include/

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102683 >From 547b4da91b20811db156a8c73fcb2f381cfed7bd Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 9 Aug 2024 10:48:10 -0700 Subject: [PATCH 1/8] suboptimal expansion of normalize done --- clang/include/

[clang] [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (PR #102414)

2024-08-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102414 >From c35e4ec3f8ea27eedc0658921d8d9055451acd91 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 7 Aug 2024 19:34:54 -0700 Subject: [PATCH 1/4] split out ROV from resource attr --- clang/include/clang/

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-12 Thread Joshua Batista via cfe-commits
@@ -4725,6 +4725,12 @@ def HLSLMad : LangBuiltin<"HLSL_LANG"> { let Prototype = "void(...)"; } +def HLSLNormalize : LangBuiltin<"HLSL_LANG"> { + let Spellings = ["__builtin_hlsl_normalize"]; bob80905 wrote: I don't believe normalize is an elementwise opera

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-12 Thread Joshua Batista via cfe-commits
@@ -18584,6 +18584,29 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, CGM.getHLSLRuntime().getLengthIntrinsic(), ArrayRef{X}, nullptr, "hlsl.length"); } + case Builtin::BI__builtin_hlsl_normalize: { +Value *X = EmitScalarExpr(E->getArg

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-12 Thread Joshua Batista via cfe-commits
@@ -229,6 +230,75 @@ static bool expandLog10Intrinsic(CallInst *Orig) { return expandLogIntrinsic(Orig, numbers::ln2f / numbers::ln10f); } +static bool expandNormalizeIntrinsic(CallInst *Orig) { + Value *X = Orig->getOperand(0); + Type *Ty = Orig->getType(); + Type *EltTy

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102683 >From 547b4da91b20811db156a8c73fcb2f381cfed7bd Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 9 Aug 2024 10:48:10 -0700 Subject: [PATCH 1/9] suboptimal expansion of normalize done --- clang/include/

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

2024-08-13 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102683 >From 547b4da91b20811db156a8c73fcb2f381cfed7bd Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 9 Aug 2024 10:48:10 -0700 Subject: [PATCH 01/11] suboptimal expansion of normalize done --- clang/includ

[clang] [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (PR #102414)

2024-08-13 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102414 >From c35e4ec3f8ea27eedc0658921d8d9055451acd91 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 7 Aug 2024 19:34:54 -0700 Subject: [PATCH 1/5] split out ROV from resource attr --- clang/include/clang/

[clang] [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (PR #102414)

2024-08-13 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/102414 >From c35e4ec3f8ea27eedc0658921d8d9055451acd91 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 7 Aug 2024 19:34:54 -0700 Subject: [PATCH 1/6] split out ROV from resource attr --- clang/include/clang/

[clang] [llvm] Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (PR #102683)

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

[clang] [llvm] Remove unused variable, and unneeded extract element instruction (PR #103489)

2024-08-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/103489 >From bb704124a6aa45fa733347ef24b5f9b462567b92 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 13 Aug 2024 17:06:28 -0700 Subject: [PATCH 1/2] remove unused var, and unneeded extract element --- llvm

[clang] [HLSL] Split out the ROV attribute from the resource attribute, make it a new spellable attribute. (PR #102414)

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

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/104239 This PR creates a new attribute in HLSL, "TextureDimension", which specifies the dimension of a specific texture resource. This PR is another necessary part of completing https://github.com/llvm/llvm-project/

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-14 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/104239 >From aaa455933d3703b84634703fd4fcb5c815aa139e Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 14 Aug 2024 14:02:22 -0700 Subject: [PATCH 1/2] create texture dimension attr --- clang/include/clang/Ba

[clang] [llvm] Remove unused variable, and unneeded extract element instruction (PR #103489)

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

[clang] Create Texture Dimension attribute in HLSL (PR #104239)

2024-08-14 Thread Joshua Batista via cfe-commits
bob80905 wrote: > What is this attribute supposed to mean? I think we need some design here > before we create the attribute, as it isn't clear to me that a single integer > covers our needs. The texture kinds that need to be representable by this and > whatever other attributes we design are

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -492,14 +999,21 @@ void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { // Validate. if (!Slot.empty()) { switch (Slot[0]) { bob80905 wrote: I've cleaned up a bit, and realized I no longer needed to pass `Slot`, when I could j

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
bob80905 wrote: I've created an issue here to test the space parameter: https://github.com/llvm/llvm-project/issues/104521 https://github.com/llvm/llvm-project/pull/97103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-15 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,506 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-04 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/2] implement binding type error for t/cbuffers and rwbuffers -

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-04 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/3] implement binding type error for t/cbuffers and rwbuffers -

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-10 Thread Joshua Batista via cfe-commits
@@ -119,8 +119,10 @@ struct BuiltinTypeDeclBuilder { ResourceKind RK, bool IsROV) { if (Record->isCompleteDefinition()) return *this; -Record->addAttr(HLSLResourceAttr::CreateImplicit(Record->getASTContext(), -

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-10 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/4] implement binding type error for t/cbuffers and rwbuffers -

[clang] [llvm] [clang] Reland Add tanf16 builtin and support for tan constrained intrinsic (PR #94559)

2024-06-07 Thread Joshua Batista via cfe-commits
bob80905 wrote: Should a test be added when the return type is a different float type than the first arg type? https://github.com/llvm/llvm-project/pull/94559 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[clang] [llvm] [clang] Reland Add tanf16 builtin and support for tan constrained intrinsic (PR #94559)

2024-06-07 Thread Joshua Batista via cfe-commits
@@ -2923,6 +2923,18 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, SetSqrtFPAccuracy(Call); return RValue::get(Call); } + +case Builtin::BItan: bob80905 wrote: What is the difference between `BItanf` an

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-06-12 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 01/14] implement binding type error for t/cbuffers and rwbuffers

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-06-20 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 01/15] implement binding type error for t/cbuffers and rwbuffers

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-06-20 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 01/15] implement binding type error for t/cbuffers and rwbuffers

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-21 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/96346 `MaybeParseHLSLAnnotations` should be run on Field Decls instead of just assuming that any colon after a field decl is a bitfield. In the case that HLSL is the language, the code after the colon may be an annot

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

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

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-21 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify + +// previously, this test would result in an error shown below on the line that +// declares variable a in struct Eg9: +// error: use of undeclared identifier +// 'SV_Dispat

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

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

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-21 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/96346 >From c267be670adf7aac050484dc1b243aa0eff60b5f Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 21 Jun 2024 11:25:22 -0700 Subject: [PATCH 1/2] parse hlsl annotations on struct, add test --- clang/lib/

[clang] [ParserHLSL] Attempt to parse HLSL annotations on Field Decls. (PR #96346)

2024-06-21 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,30 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s -verify bob80905 wrote: There are currently no candidate attributes that have subjects that are field decls other than SV_DispatchThreadID. In other words, SV_DispatchTh

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-17 Thread Joshua Batista via cfe-commits
@@ -482,15 +484,18 @@ static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, bool IsROV) { return BuiltinTypeDeclBuilder(Decl) .addHandleMember() - .addDefaultHandleConstructor(S, RC) - .annot

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/5] implement binding type error for t/cbuffers and rwbuffers -

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/5] implement binding type error for t/cbuffers and rwbuffers -

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/89309 The attribute name "HLSLSemantics" is confusing, because semantics aren't always the annotation that are applied to specific variables. The name for this attribute needs to be less specific. This PR changes the

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-18 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/6] implement binding type error for t/cbuffers and rwbuffers -

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

2024-04-22 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/89309 >From 58f7f1c7f99f29fea39b5bd83bb74d3770a6f985 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 18 Apr 2024 13:38:51 -0700 Subject: [PATCH 1/2] rename hlsl semantics to hlsl annotations --- clang/inclu

[clang] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-22 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/7] implement binding type error for t/cbuffers and rwbuffers -

[clang] Add clang_elementwise_builtin_alias (PR #86175)

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

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/101256 This PR adds the length intrinsic and an HLSL function that uses it. The SPIRV implementation is left for a future PR. Fixes #99134 >From 7027cf254ae1b6acfdfbbf5dbeda3c4d6a4b3c43 Mon Sep 17 00:00:00 2001 From:

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101256 >From 7027cf254ae1b6acfdfbbf5dbeda3c4d6a4b3c43 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 26 Jul 2024 15:41:01 -0700 Subject: [PATCH 1/2] first attempt --- clang/docs/LanguageExtensions.rst

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-30 Thread Joshua Batista via cfe-commits
@@ -249,6 +249,7 @@ DWARF Support in Clang Floating Point Support in Clang --- +- Add ``__builtin_elementwise_length``builtin for floating point types only. bob80905 wrote: Ah, this was a habit that seems to no longer be justified.

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

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

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-30 Thread Joshua Batista via cfe-commits
@@ -18460,6 +18460,22 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, /*ReturnType=*/X->getType(), CGM.getHLSLRuntime().getLerpIntrinsic(), ArrayRef{X, Y, S}, nullptr, "hlsl.lerp"); } + case Builtin::BI__builtin_hlsl_elementwise_length: {

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-30 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101256 >From 7027cf254ae1b6acfdfbbf5dbeda3c4d6a4b3c43 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 26 Jul 2024 15:41:01 -0700 Subject: [PATCH 1/4] first attempt --- clang/docs/LanguageExtensions.rst

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-30 Thread Joshua Batista via cfe-commits
@@ -18460,6 +18460,22 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, /*ReturnType=*/X->getType(), CGM.getHLSLRuntime().getLerpIntrinsic(), ArrayRef{X, Y, S}, nullptr, "hlsl.lerp"); } + case Builtin::BI__builtin_hlsl_elementwise_length: {

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-30 Thread Joshua Batista via cfe-commits
@@ -1079,6 +1079,28 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { return true; break; } + case Builtin::BI__builtin_hlsl_elementwise_length: { +if (SemaRef.checkArgCount(TheCall, 1)) + return true; +if (SemaRef.Pr

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-31 Thread Joshua Batista via cfe-commits
@@ -18460,6 +18460,22 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, /*ReturnType=*/X->getType(), CGM.getHLSLRuntime().getLerpIntrinsic(), ArrayRef{X, Y, S}, nullptr, "hlsl.lerp"); } + case Builtin::BI__builtin_hlsl_elementwise_length: {

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-31 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,107 @@ +; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK +; RUN: opt -S -dxil-op-lower < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK + +; ModuleID = 'D:\llvm-project\clang\test\CodeGenHLSL\builtins\length.hlsl' +sou

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-31 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,107 @@ +; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK +; RUN: opt -S -dxil-op-lower < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK + +; ModuleID = 'D:\llvm-project\clang\test\CodeGenHLSL\builtins\length.hlsl' +sou

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-31 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,107 @@ +; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s --check-prefixes=CHECK,EXPCHECK +; RUN: opt -S -dxil-op-lower < %s | FileCheck %s --check-prefixes=CHECK,DOPCHECK + +; ModuleID = 'D:\llvm-project\clang\test\CodeGenHLSL\builtins\length.hlsl' +sou

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101256 >From 7027cf254ae1b6acfdfbbf5dbeda3c4d6a4b3c43 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 26 Jul 2024 15:41:01 -0700 Subject: [PATCH 1/5] first attempt --- clang/docs/LanguageExtensions.rst

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101256 >From 7027cf254ae1b6acfdfbbf5dbeda3c4d6a4b3c43 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 26 Jul 2024 15:41:01 -0700 Subject: [PATCH 1/6] first attempt --- clang/docs/LanguageExtensions.rst

[clang] [llvm] Add length HLSL function to DirectX Backend (PR #101256)

2024-07-31 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/101256 >From 7027cf254ae1b6acfdfbbf5dbeda3c4d6a4b3c43 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Fri, 26 Jul 2024 15:41:01 -0700 Subject: [PATCH 1/7] first attempt --- clang/docs/LanguageExtensions.rst

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-15 Thread Joshua Batista via cfe-commits
@@ -1,9 +1,10 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify -// expected-error@+1 {{invalid resource class specifier 'c' used; expected 'b', 's', 't', or 'u'}} -float a : register(c0, space1); +// valid, The register keywor

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-07-16 Thread Joshua Batista via cfe-commits
@@ -459,7 +467,475 @@ void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(HLSLResourceClassAttr::Create(getASTContext(), RC, ArgLoc)); } -void SemaHLSL::handleResourceBindingAttr(Decl *D, const ParsedAttr &AL) { +struct RegisterBindingFlags {

[clang] [lldb] [HLSL] Implement intangible AST type (PR #97362)

2024-07-18 Thread Joshua Batista via cfe-commits
bob80905 wrote: Just an FYI, the syntax for adding a resource_class attribute as currently implemented looks like this: `[[hlsl::resource_class(SRV)]]` In your description, you may want to update this and other similar attributes. https://github.com/llvm/llvm-project/pull/97362

[clang] [NFC] Rename hlsl semantics to hlsl annotations (PR #89309)

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

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-23 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/8] implement binding type error for t/cbuffers and rwbuffers -

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-23 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// the below will cause an llvm unreachable, because RWBuffers don't have resource attributes yet +// NOT YET IMPLEMENTED : {{invalid register name prefix 'b' for

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-23 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// the below will cause an llvm unreachable, because RWBuffers don't have resource attributes yet +// NOT YET IMPLEMENTED : {{invalid register name prefix 'b' for

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-23 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// the below will cause an llvm unreachable, because RWBuffers don't have resource attributes yet +// NOT YET IMPLEMENTED : {{invalid register name prefix 'b' for

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-23 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 1/9] implement binding type error for t/cbuffers and rwbuffers -

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-24 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,74 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// the below will cause an llvm unreachable, because RWBuffers don't have resource attributes yet +// NOT YET IMPLEMENTED : {{invalid register name prefix 'b' for

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-24 Thread Joshua Batista via cfe-commits
@@ -12154,6 +12154,8 @@ def err_hlsl_missing_semantic_annotation : Error< def err_hlsl_init_priority_unsupported : Error< "initializer priorities are not supported in HLSL">; +def err_hlsl_mismatching_register_resource_type_and_name: Error<"invalid register name prefix '%0'

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-24 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 01/10] implement binding type error for t/cbuffers and rwbuffers

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-25 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/87578 >From 3960050439964fe3c0536696490b284a6c470cd1 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Wed, 3 Apr 2024 13:15:59 -0700 Subject: [PATCH 01/11] implement binding type error for t/cbuffers and rwbuffers

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-29 Thread Joshua Batista via cfe-commits
@@ -44,7 +44,7 @@ void foo2() { // expected-warning@+1 {{'register' attribute only applies to cbuffer/tbuffer and external global variables}} extern RWBuffer U2 : register(u5); } -// FIXME: expect-error once fix https://github.com/llvm/llvm-project/issues/57886. +// expec

[clang] [llvm] Implement resource binding type prefix mismatch errors (PR #87578)

2024-04-29 Thread Joshua Batista via cfe-commits
@@ -44,7 +44,7 @@ void foo2() { // expected-warning@+1 {{'register' attribute only applies to cbuffer/tbuffer and external global variables}} extern RWBuffer U2 : register(u5); } -// FIXME: expect-error once fix https://github.com/llvm/llvm-project/issues/57886. +// expec

[clang] [HLSL] Apply NoRecurse attrib to all HLSL functions (PR #105907)

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

[clang] [HLSL] Add HLSLAttributedResourceType (PR #106181)

2024-08-27 Thread Joshua Batista via cfe-commits
@@ -6067,6 +6082,9 @@ namespace { void VisitBTFTagAttributedTypeLoc(BTFTagAttributedTypeLoc TL) { // nothing } +void VisitHLSLResourcedAttributedTypeLoc(HLSLAttributedResourceTypeLoc TL) { bob80905 wrote: I am unsure if this function is name

[clang] [HLSL] Add HLSLAttributedResourceType (PR #106181)

2024-08-27 Thread Joshua Batista via cfe-commits
@@ -8803,6 +8821,12 @@ static void processTypeAttrs(TypeProcessingState &state, QualType &type, attr.setUsedAsTypeAttr(); break; } +case ParsedAttr::AT_HLSLResourceClass: bob80905 wrote: Could you add a TODO to add more cases for the attri

[clang] [HLSL] Add HLSLAttributedResourceType (PR #106181)

2024-08-27 Thread Joshua Batista via cfe-commits
@@ -799,6 +799,19 @@ static bool IsEquivalentExceptionSpec(StructuralEquivalenceContext &Context, return true; } +// Determine structural equivalence of two instances of +// HLSLAttributedResourceType::Attributes +static bool +IsStructurallyEquivalent(StructuralEquivalenceC

[clang] [HLSL] Add HLSLAttributedResourceType (PR #106181)

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

[clang] [HLSL] Add HLSLAttributedResourceType (PR #106181)

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

[clang] [HLSL] Add StructuredBuffer to external sema source (PR #106316)

2024-08-27 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/106316 This PR adds `StructuredBuffer` to `HLSLExternalSemaSource.cpp`, by copying the logic from RWBuffer but just replacing the name with StructuredBuffer. The change now allows StructuredBuffers to be defined in H

[clang] [HLSL] Add StructuredBuffer to external sema source (PR #106316)

2024-08-27 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/106316 >From 7089ee170132c4a7529f6729919641f1db462566 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 27 Aug 2024 17:26:58 -0700 Subject: [PATCH] add StructuredBuffer to hlsl external sema source --- clang/

[clang] [HLSL] Add StructuredBuffer to external sema source (PR #106316)

2024-08-27 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/106316 >From 7089ee170132c4a7529f6729919641f1db462566 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 27 Aug 2024 17:26:58 -0700 Subject: [PATCH] add StructuredBuffer to hlsl external sema source --- clang/

[clang] [HLSL] Add StructuredBuffer to external sema source (PR #106316)

2024-08-27 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 updated https://github.com/llvm/llvm-project/pull/106316 >From 7089ee170132c4a7529f6729919641f1db462566 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Tue, 27 Aug 2024 17:26:58 -0700 Subject: [PATCH 1/2] add StructuredBuffer to hlsl external sema source --- cl

[clang] [HLSL] Add StructuredBuffer to external sema source (PR #106316)

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

[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

2024-08-28 Thread Joshua Batista via cfe-commits
@@ -0,0 +1,103 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify + +// TODO: Implement "Buffer" +struct Eg1 { + float f; + // Buffer Buf; + RWBuffer RWBuf; + }; +Eg1 e1 : /* register(t0) :*/ register(u0); +// Valid: f is skip

[clang] [llvm] Add step builtins and step HLSL function to DirectX and SPIR-V backend (PR #106471)

2024-08-28 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/106471 This PR adds the step intrinsic and an HLSL function that uses it. The SPIRV backend is also implemented. Used https://github.com/llvm/llvm-project/pull/102683 as a reference. Fixes https://github.com/llvm/llvm

<    1   2   3   4   5   6   >