[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)

2024-08-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. A few minor suggestions, but otherwise looks good. https://github.com/llvm/llvm-project/pull/101240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-30 Thread Chris B via cfe-commits
llvm-beanz wrote: ping @rjmccall. I think I've updated to address all your feedback. Let me know if there's anything else you think I should change. https://github.com/llvm/llvm-project/pull/101083 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[clang] [HLSL][Doc] Document multi-argument resolution (PR #104474)

2024-08-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/104474 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Allow truncation to scalar (PR #104844)

2024-08-30 Thread Chris B via cfe-commits
@@ -143,19 +143,3 @@ float test_dot_float3(float3 p0, float3 p1) { return dot(p0, p1); } // CHECK: %dx.dot = call float @llvm.dx.dot4.v4f32(<4 x float> %0, <4 x float> %1) // CHECK: ret float %dx.dot float test_dot_float4(float4 p0, float4 p1) { return dot(p0, p1); } - -// CH

[clang] [HLSL][Docs] Update function calls docs (PR #106860)

2024-08-31 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/106860 Update the function calls documentation to match the newly landed implementation. >From f3ee9f197eced0f7496c611f09dd684d84325f26 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Sat, 31 Aug 2024 11:16:28

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-31 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/101083 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix implicit conversion rank ordering (PR #106811)

2024-08-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/106811 DXC prefers dimension-preserving conversions over precision-losing conversions. This means a double4 -> float4 conversion is preferred over a double4 -> double3 or double4 -> double conversion. >From 4abb34

[clang] Fix implicit conversion rank ordering (PR #106811)

2024-08-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/106811 >From 4abb34b1b21e666e20a9b3bad8af146d3bf322f0 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 30 Aug 2024 23:54:41 + Subject: [PATCH 1/2] Fix implicit conversion rank ordering DXC prefers dimen

[clang] [HLSL] set alwaysinline on HLSL functions (PR #106588)

2024-09-03 Thread Chris B via cfe-commits
@@ -414,9 +414,20 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl *FD, void CGHLSLRuntime::setHLSLFunctionAttributes(const FunctionDecl *FD, llvm::Function *Fn) { - if (FD->isInExportDeclContext()) { -const String

[clang] Fix implicit conversion rank ordering (PR #106811)

2024-09-03 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/106811 >From 4abb34b1b21e666e20a9b3bad8af146d3bf322f0 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 30 Aug 2024 23:54:41 + Subject: [PATCH 1/2] Fix implicit conversion rank ordering DXC prefers dimen

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: I’ll give this a deeper read tomorrow, but I’ve left some comments mostly on coding convention and style issues. https://github.com/llvm/llvm-project/pull/97103 ___ cfe-commits mailing list cfe-commits@lists.ll

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -38,6 +38,22 @@ Decl *SemaHLSL::ActOnStartBuffer(Scope *BufferScope, bool CBuffer, HLSLBufferDecl *Result = HLSLBufferDecl::Create( getASTContext(), LexicalParent, CBuffer, KwLoc, Ident, IdentLoc, LBrace); + HLSLResourceAttr *NewAttr; + if (CBuffer) { +NewAtt

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -490,34 +490,36 @@ void HLSLExternalSemaSource::defineTrivialHLSLTypes() { } /// Set up common members and attributes for buffer types -static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, - ResourceClass R

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
@@ -437,7 +453,409 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr &AL) { D->addAttr(NewAttr); } +struct RegisterBindingFlags { + bool Resource = false; + bool Udt = false; + bool Other = false; + bool Basic = false; + + bool Srv = false; + bool Uav = f

[clang] Implement resource binding type prefix mismatch flag setting logic (PR #97103)

2024-07-08 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/97103 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] RFC: [cmake] Export CLANG_RESOURCE_DIR in ClangConfig (PR #97197)

2024-07-10 Thread Chris B via cfe-commits
llvm-beanz wrote: Is there a reason you need to collect those files for your build tree instead of using them from where Clang built/installed them? https://github.com/llvm/llvm-project/pull/97197 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[clang] RFC: [cmake] Export CLANG_RESOURCE_DIR in ClangConfig (PR #97197)

2024-07-12 Thread Chris B via cfe-commits
llvm-beanz wrote: > I think at the time we started doing this, Clang's builtin includes lookup > basically did `$dirname($0)/../lib/llvm-$version/clang/$version/include`. So > when building `include-what-you-use` in a separate tree, the resulting binary > didn't have the builtin headers in the

[clang] RFC: [cmake] Export CLANG_RESOURCE_DIR in ClangConfig (PR #97197)

2024-07-12 Thread Chris B via cfe-commits
llvm-beanz wrote: (cc @compnerd, @gottesmm, & @etcwilde who have played roles in building and maintaining all the build-tree stuff for Swift). https://github.com/llvm/llvm-project/pull/97197 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [HLSL] Rework implicit conversion sequences (PR #96011)

2024-07-12 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/96011 >From 84c6a2c9dea0d964db68b282b0236783a46ee292 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 18 Jun 2024 20:25:57 -0500 Subject: [PATCH] [HLSL] Rework implicit conversion sequences This PR reworks

[clang] [HLSL] Rework implicit conversion sequences (PR #96011)

2024-07-12 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/96011 >From 84c6a2c9dea0d964db68b282b0236783a46ee292 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 18 Jun 2024 20:25:57 -0500 Subject: [PATCH 1/2] [HLSL] Rework implicit conversion sequences This PR rewo

[clang] [HLSL] Rework implicit conversion sequences (PR #96011)

2024-07-12 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/96011 >From 84c6a2c9dea0d964db68b282b0236783a46ee292 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 18 Jun 2024 20:25:57 -0500 Subject: [PATCH 1/3] [HLSL] Rework implicit conversion sequences This PR rewo

[clang] RFC: [cmake] Export CLANG_RESOURCE_DIR in ClangConfig (PR #97197)

2024-07-13 Thread Chris B via cfe-commits
llvm-beanz wrote: @kimgr you should be able to have CMake query the path of libclang and go from there. Something like: ```cmake get_target_property(SHARED_LIB_DIR libclang RUNTIME_OUTPUT_DIRECTORY) ``` That should give you the binary location of libclang, which should work for resolving the

[clang] [HLSL] Rework implicit conversion sequences (PR #96011)

2024-07-13 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/96011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Pipelines] Do not run CoroSplit and CoroCleanup in LTO pre-link pipeline (PR #90310)

2024-04-30 Thread Chris B via cfe-commits
@@ -0,0 +1,77 @@ +// This tests that the coroutine elide optimization could happen succesfully with ThinLTO. +// This test is adapted from coro-elide.cpp and splits functions into two files. +// +// RUN: split-file %s %t +// RUN: %clang --target=x86_64-linux -std=c++20 -O2 -flto

[clang] [NFC][HLSL] Cleanup TargetInfo handling (PR #90694)

2024-04-30 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/90694 We had some odd places where we set target behaviors. We were setting the long size in target-specific code, but it should be language-based. We were not setting the Half float type semantics correctly, and i

[clang] [NFC][HLSL] Cleanup TargetInfo handling (PR #90694)

2024-04-30 Thread Chris B via cfe-commits
@@ -406,6 +406,16 @@ void TargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts) { LongDoubleAlign = 64; } + // HLSL explicitly defines the sizes and formats of some data types, and we + // need to conform to those regardless of what architecture you are tar

[clang] [llvm] [Pipelines] Do not run CoroSplit and CoroCleanup in LTO pre-link pipeline (PR #90310)

2024-05-01 Thread Chris B via cfe-commits
@@ -0,0 +1,77 @@ +// This tests that the coroutine elide optimization could happen succesfully with ThinLTO. +// This test is adapted from coro-elide.cpp and splits functions into two files. +// +// RUN: split-file %s %t +// RUN: %clang --target=x86_64-linux -std=c++20 -O2 -flto

[clang] [NFC][HLSL] Cleanup TargetInfo handling (PR #90694)

2024-05-01 Thread Chris B via cfe-commits
@@ -1612,15 +1612,7 @@ const llvm::fltSemantics &ASTContext::getFloatTypeSemantics(QualType T) const { case BuiltinType::Float16: return Target->getHalfFormat(); case BuiltinType::Half: -// For HLSL, when the native half type is disabled, half will be treat as -

[clang] [NFC][HLSL] Cleanup TargetInfo handling (PR #90694)

2024-05-01 Thread Chris B via cfe-commits
@@ -406,6 +406,16 @@ void TargetInfo::adjust(DiagnosticsEngine &Diags, LangOptions &Opts) { LongDoubleAlign = 64; } + // HLSL explicitly defines the sizes and formats of some data types, and we + // need to conform to those regardless of what architecture you are tar

[clang] [HLSL] Cleanup TargetInfo handling (PR #90694)

2024-05-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/90694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Cleanup TargetInfo handling (PR #90694)

2024-05-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/90694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Cleanup TargetInfo handling (PR #90694)

2024-05-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/90694 >From 2464bcb75b047c49076f0718470f27a561252a62 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 30 Apr 2024 20:49:35 -0500 Subject: [PATCH 1/2] [NFC][HLSL] Cleanup TargetInfo handling We had some odd

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Chris B via cfe-commits
@@ -4372,6 +4372,13 @@ def HLSLResourceBinding: InheritableAttr { let Documentation = [HLSLResourceBindingDocs]; } +def HLSLPackOffset: HLSLAnnotationAttr { + let Spellings = [HLSLAnnotation<"packoffset">]; + let LangOpts = [HLSL]; + let Args = [IntArgument<"Offset">]; --

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
@@ -0,0 +1,229 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type -finclude-default-header -Wconversion -verify -o - %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type -finclude-default-header -ast-dump %s | FileCheck %

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
@@ -2616,6 +2617,13 @@ bool Sema::IsFloatingPointPromotion(QualType FromType, QualType ToType) { ToBuiltin->getKind() == BuiltinType::Ibm128)) return true; + // In HLSL, `half` promotes to `float` or `double`, regardless of whether + // or not nat

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
@@ -4393,6 +4401,24 @@ getFixedEnumPromtion(Sema &S, const StandardConversionSequence &SCS) { return FixedEnumPromotion::ToPromotedUnderlyingType; } +static ImplicitConversionSequence::CompareKind +HLSLCompareFloatingRank(QualType LHS, QualType RHS) { + assert(LHS->isVecto

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
@@ -0,0 +1,229 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type -finclude-default-header -Wconversion -verify -o - %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -fnative-half-type -finclude-default-header -ast-dump %s | FileCheck %

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/90222 >From a173605b6043739e69f89d3a559a4f6a68d5fc0a Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 25 Apr 2024 15:47:22 -0500 Subject: [PATCH 1/2] [HLSL] Shore up floating point conversions This PR fixes

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Chris B via cfe-commits
@@ -4372,6 +4372,13 @@ def HLSLResourceBinding: InheritableAttr { let Documentation = [HLSLResourceBindingDocs]; } +def HLSLPackOffset: HLSLAnnotationAttr { + let Spellings = [HLSLAnnotation<"packoffset">]; + let LangOpts = [HLSL]; + let Args = [IntArgument<"Offset">]; --

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Chris B via cfe-commits
@@ -108,3 +108,18 @@ behavior between Clang and DXC. Some examples include: diagnostic notifying the user of the conversion rather than silently altering precision relative to the other overloads (as FXC does) or generating code that will fail validation (as DXC does). +

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz requested changes to this pull request. I'm marking this as requesting changes because I don't think we should land this as-is. https://github.com/llvm/llvm-project/pull/89836 ___ cfe-commits mailing list cfe-commits@list

[clang] [HLSL] Shore up floating point conversions (PR #90222)

2024-05-02 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/90222 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Cleanup TargetInfo handling (PR #90694)

2024-05-02 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/90694 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [compiler-rt] [flang] [lld] [lldb] [llvm] [mlir] [openmp] [pstl] Finally formalise our defacto line-ending policy (PR #86318)

2024-05-03 Thread Chris B via cfe-commits
llvm-beanz wrote: > I don't know if the pre-commit testing guarantees that. Configuration > settings will permit the files to be checked out in either Unix (`\n`) or > Windows (`\r\n`) line-endings. Today on Windows you basically have to check out LLVM as unix line endings. There are a bunch

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-03 Thread Chris B via cfe-commits
@@ -1200,6 +1224,27 @@ std::string Triple::normalize(StringRef Str) { } } + // Normalize DXIL triple if it does not include DXIL version number. + // Determine DXIL version number using the minor version number of Shader + // Model version specified in target triple,

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-03 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: Given that @bogner had concerns about the other approach I think we should get him to review this before moving forward. That said, other than some missing unit test coverage I think this approach looks fine. https://github.com/llvm/llvm-project/pull/9

[clang] [HLSL] Implement 202x conforming literals (PR #91015)

2024-05-03 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/91015 This implements the HLSL 202x conforming literals feature. The feature proposal is available here: https://github.com/microsoft/hlsl-specs/blob/main/proposals/0017-conform ing-literals.md The language specif

[clang] [HLSL] Implement 202x conforming literals (PR #91015)

2024-05-03 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/91015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement 202x conforming literals (PR #91015)

2024-05-03 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/91015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-06 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/90809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Implement 202x conforming literals (PR #91015)

2024-05-06 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/91015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [DirectX][DXIL] Set DXIL Version in DXIL target triple based on shader model version (PR #90809)

2024-05-07 Thread Chris B via cfe-commits
@@ -1206,6 +1233,47 @@ std::string Triple::normalize(StringRef Str) { } } + // Normalize DXIL triple if it does not include DXIL version number. + // Determine DXIL version number using the minor version number of Shader + // Model version specified in target triple,

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-07 Thread Chris B via cfe-commits
@@ -4372,6 +4372,13 @@ def HLSLResourceBinding: InheritableAttr { let Documentation = [HLSLResourceBindingDocs]; } +def HLSLPackOffset: HLSLAnnotationAttr { + let Spellings = [HLSLAnnotation<"packoffset">]; + let LangOpts = [HLSL]; + let Args = [IntArgument<"Offset">]; --

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-07 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/89836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Support packoffset attribute in AST (PR #89836)

2024-05-07 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. https://github.com/llvm/llvm-project/pull/89836 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL][CMake] Add clangd and distribution settings (PR #92011)

2024-05-13 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/92011 This just adds some simple distribution settings and includes clangd in the build for distribution. >From e1b82c5bb1869ac74080e17633bd8ac7931a47b6 Mon Sep 17 00:00:00 2001 From: Chris B Date: Mon, 13 May 202

[clang] [HLSL][CMake] Add clangd and distribution settings (PR #92011)

2024-05-13 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/92011 >From e1b82c5bb1869ac74080e17633bd8ac7931a47b6 Mon Sep 17 00:00:00 2001 From: Chris B Date: Mon, 13 May 2024 13:55:49 -0500 Subject: [PATCH 1/2] [HLSL][CMake] Add clangd and distribution settings This just ad

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-14 Thread Chris B via cfe-commits
@@ -376,26 +400,46 @@ static void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, // not specified for deployment targets >= to iOS 11 or equivalent or // for declarations that were introduced in iOS 11 (macOS 10.13, ...) or // later. -const Availabili

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-14 Thread Chris B via cfe-commits
@@ -772,40 +816,58 @@ void DiagnoseUnguardedAvailability::DiagnoseDeclAvailability( const AvailabilityAttr *AA = getAttrForPlatform(SemaRef.getASTContext(), OffendingDecl); +bool EnvironmentMatchesOrNone = +hasMatchingEnvironmentOrNone(SemaRef.getASTCont

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-14 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: Overall this looks good to me. One set of suggestions inline. https://github.com/llvm/llvm-project/pull/89809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-15 Thread Chris B via cfe-commits
@@ -5671,6 +5671,54 @@ HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext &C, SourceLocation(), SourceLocation()); } +static uint64_t calculateLegacyCbufferAlign(const ASTContext &Context, +

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: I'm a little concerned about the strategy here. LLVM generally doesn't explicitly capture padding it relies on the data layout rules to capture that. If this is the approach we're going with you can't put any vectors or matrices into the cbuffer structu

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Chris B via cfe-commits
llvm-beanz wrote: > Could you explain more about can't put any vectors or matrices into the > cbuffer structure type? Consider this example (regardless of packoffset): ```hlsl cbuffer { float F; float2 V; } ``` The layout for this is basically: ```c struct { float F; float Vx; // v.x

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Chris B via cfe-commits
llvm-beanz wrote: > You can use `type <{ float, <2 x float>}>` if you need the tightly-packed > layout. I think we need to figure out how we're going to lower this too. Loading from this memory space requires loading 128 bytes at a time, and we need to slice it down to just the parts of the s

[clang] [HLSL] support packoffset in clang codeGen (PR #91999)

2024-05-16 Thread Chris B via cfe-commits
llvm-beanz wrote: > This PR will not change this. The padding will only be added when required. _That's the problem_ > > ```hlsl > cbuffer { > float F; > float2 V; > } > ``` > > will still got > > ```llvm > type { float, <2 x float>} > ``` And there will implicitly be padding between th

[clang] [HLSL][CMake] Add clangd and distribution settings (PR #92011)

2024-05-17 Thread Chris B via cfe-commits
@@ -8,6 +8,12 @@ set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "DirectX;SPIRV" CACHE STRING "") # HLSL support is currently limted to clang, eventually it will expand to # clang-tools-extra too. -set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "") +set(LLVM_ENABLE_PROJECTS "clang;clan

[clang] [HLSL][CMake] Add clangd and distribution settings (PR #92011)

2024-05-17 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/92011 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-17 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/89809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-17 Thread Chris B via cfe-commits
llvm-beanz wrote: nit: we've generally tried to keep the HLSL-specific tests separated from the other language tests (i.e. SemaHLSL). https://github.com/llvm/llvm-project/pull/89809 ___ cfe-commits mailing list cfe-c

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-17 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: A couple comments, but mostly this looks good to me. https://github.com/llvm/llvm-project/pull/89809 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-17 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/92207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-17 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. A few small suggestions feel free to take them or leave them, otherwise looks good. https://github.com/llvm/llvm-project/pull/92207 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-17 Thread Chris B via cfe-commits
@@ -0,0 +1,139 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable sh

[clang] HLSL availability diagnostics design doc (PR #92207)

2024-05-17 Thread Chris B via cfe-commits
@@ -0,0 +1,139 @@ += +HLSL Availability Diagnostics += + +.. contents:: + :local: + +Introduction + + +HLSL availability diagnostics emits errors or warning when unavailable shader APIs are used. Unavailable sh

[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

2024-05-17 Thread Chris B via cfe-commits
llvm-beanz wrote: I think the different slice there is platform vs language. SemaHLSL should be where HLSL tests go regardless of platform (DirectX or Vulkan), but we should try to keep HLSL separate from C/C++ tests. https://github.com/llvm/llvm-project/pull

[clang] [HLSL][CMake] Cache files don't have generator vars (PR #92793)

2024-05-20 Thread Chris B via cfe-commits
https://github.com/llvm-beanz created https://github.com/llvm/llvm-project/pull/92793 Doh! CMake cache scripts don't have generator variables set yet, so the script can't depend on the generator variables. Instead I've added a variable that a user can specify to enable the distribution setting

[clang] [HLSL][CMake] Cache files don't have generator vars (PR #92793)

2024-05-20 Thread Chris B via cfe-commits
llvm-beanz wrote: Merging before the PR bots finish since the PR bots don't actually use this file anyways... https://github.com/llvm/llvm-project/pull/92793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [HLSL][CMake] Cache files don't have generator vars (PR #92793)

2024-05-20 Thread Chris B via cfe-commits
https://github.com/llvm-beanz closed https://github.com/llvm/llvm-project/pull/92793 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable unguarded availability diagnostic on instantiated template functions (PR #91699)

2024-05-23 Thread Chris B via cfe-commits
https://github.com/llvm-beanz approved this pull request. We've waited a week on this PR to see if anyone from Apple will chime in. On previous PRs we waited weeks and got no response. We've reached out on Discord too. This PR looks sane to me and it seems to have adequate testing. I think we

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-23 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/92704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-23 Thread Chris B via cfe-commits
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch( << A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage) << (AllowedStages.size() != 1) << join(StageStrings, ", "); } + +namespace { + +/// This class implements HLSL availability diagnostics for default

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-23 Thread Chris B via cfe-commits
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch( << A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage) << (AllowedStages.size() != 1) << join(StageStrings, ", "); } + +namespace { + +/// This class implements HLSL availability diagnostics for default

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-23 Thread Chris B via cfe-commits
@@ -1068,11 +1068,37 @@ static llvm::StringRef getPrettyEnviromentName(llvm::StringRef Environment) { .Case("hull", "hull shader") .Case("domain", "domain shader") .Case("compute", "compute shader") + .Case("raygeneration", "r

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-23 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: Looks pretty good to me. A few nits that you can take or leave. The one real concern I have is that I actually don't like `getPrettyEnviromentName` being a string->string mapping. Is it possible to instead use the Triple environment enum? https://githu

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-23 Thread Chris B via cfe-commits
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch( << A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage) << (AllowedStages.size() != 1) << join(StageStrings, ", "); } + +namespace { + +/// This class implements HLSL availability diagnostics for default

[clang] [HLSL] Default and Relaxed Availability Diagnostics (PR #92704)

2024-05-23 Thread Chris B via cfe-commits
@@ -290,3 +294,295 @@ void SemaHLSL::DiagnoseAttrStageMismatch( << A << HLSLShaderAttr::ConvertShaderTypeToStr(Stage) << (AllowedStages.size() != 1) << join(StageStrings, ", "); } + +namespace { + +/// This class implements HLSL availability diagnostics for default

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-01 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/101083 >From e8ec3e24e0061714b5dc440b1b92086965809483 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 29 Jul 2024 16:05:11 -0500 Subject: [PATCH 1/8] [HLSL] Implement output parameter HLSL output parameter

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-01 Thread Chris B via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -finclude-default-header -verify -Wdouble-promotion -Wconversion %s + +void OutVecFn(out float3) {} +void InOutVecFn(inout float3) {} + +// Case 1: Calling out and inout parameters with types that cannot

[clang] RFC: [cmake] Export CLANG_RESOURCE_DIR in ClangConfig (PR #97197)

2024-08-02 Thread Chris B via cfe-commits
llvm-beanz wrote: > So I'm thinking even if the `clang-resource-headers` target was available, it > would not give the path to the resource dir, but rather the path to the > subdir containing the builtin headers. That might be fine, i.e. I could take > that path and add it with `-isystem ...`,

[clang] [HLSL] Change default linkage of HLSL functions and groupshared variables (v2) (PR #95331)

2024-08-02 Thread Chris B via cfe-commits
@@ -354,6 +354,23 @@ llvm::Value *CGHLSLRuntime::emitInputSemantic(IRBuilder<> &B, return nullptr; } +void CGHLSLRuntime::emitFunctionProlog(const FunctionDecl *FD, llvm-beanz wrote: I think this is poorly named. It isn't emitting a function prolog it is e

[clang] [HLSL] Change default linkage of HLSL functions and groupshared variables (v2) (PR #95331)

2024-08-02 Thread Chris B via cfe-commits
@@ -664,11 +664,25 @@ LinkageComputer::getLVForNamespaceScopeDecl(const NamedDecl *D, if (PrevVar->getStorageClass() == SC_Static) return LinkageInfo::internal(); } + +if (Context.getLangOpts().HLSL && +Var->hasAttr()) + return LinkageInfo::i

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-05 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/101083 >From e8ec3e24e0061714b5dc440b1b92086965809483 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 29 Jul 2024 16:05:11 -0500 Subject: [PATCH 1/9] [HLSL] Implement output parameter HLSL output parameter

[clang] [HLSL] Implement output parameter (PR #101083)

2024-08-05 Thread Chris B via cfe-commits
llvm-beanz wrote: @rjmccall curious if you have some time to look at this PR. I've made some small changes to extend parameter ABI annotations and write back arguments (used by ObjC) to cover HLSL's odd parameter behaviors. https://github.com/llvm/llvm-project/pull/101083 _

<    1   2   3   4   5   6   7   8   9   10   >