https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/87270
>From c4dd0ba015dd51eea423d5d52d4afa9b2e92d514 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Mon, 1 Apr 2024 13:24:00 -0500
Subject: [PATCH 1/2] [HLSL] Implement floating literal suffixes
This change im
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/87270
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,37 @@
+//===- SemaHLSL.h - Semantic Analysis for HLSL constructs
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/llvm-beanz approved this pull request.
I really like this direction. Thank you for taking the initiative on cleaning
Sema up!
I had one small comment below, but you can take it or leave it.
https://github.com/llvm/llvm-project/pull/87912
_
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/87912
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz requested changes to this pull request.
I think we need to break this PR up into different parts going to different
places.
Documenting the RootSignature grammar and usage in the Clang docs makes sense.
I think documentation of the RootSignature binary format prob
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/92591
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
LGTM. Sorry for the delay.
https://github.com/llvm/llvm-project/pull/92591
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/93454
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
I think dependencies for object libraries are implicitly `INTERAFCE`, but it
might be nice to make that explicit. I know CMake complains if you mix and
match implicit and explicit specification of linkage types.
Otherwise LGTM.
https:/
@@ -194,18 +194,20 @@ macro(add_clang_symlink name dest)
endmacro()
function(clang_target_link_libraries target type)
- if (TARGET obj.${target})
-target_link_libraries(obj.${target} ${ARGN})
- endif()
-
get_property(LLVM_DRIVER_TOOLS GLOBAL PROPERTY LLVM_DRIVER_TOOLS
@@ -194,18 +194,20 @@ macro(add_clang_symlink name dest)
endmacro()
function(clang_target_link_libraries target type)
- if (TARGET obj.${target})
-target_link_libraries(obj.${target} ${ARGN})
- endif()
-
get_property(LLVM_DRIVER_TOOLS GLOBAL PROPERTY LLVM_DRIVER_TOOLS
llvm-beanz wrote:
@nico, am I correct to assume those aren't false positives, just a bunch of
places that didn't warn before?
https://github.com/llvm/llvm-project/pull/91699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.or
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/95489
In HLSL we really want to be using the HLSL vector template and other built-in
sugared spellings for some builtin types. This updates the type printer to take
an option to use HLSL type spellings.
This chang
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/95489
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/95489
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/93860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/96011
This PR reworks HLSL's implicit conversion sequences. Initially I was seeking
to match DXC's behavior more closely, but that was leading to a pile of special
case rules to tie-break ambiguous cases that shoul
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/96011
>From 0baa7ec1ded4fa093092d491eaa2c803b736742b 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
@@ -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
@@ -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
@@ -1060,18 +1060,25 @@ static llvm::StringRef
canonicalizePlatformName(llvm::StringRef Platform) {
.Case("ShaderModel", "shadermodel")
.Default(Platform);
}
-static llvm::StringRef getPrettyEnviromentName(llvm::StringRef Environment) {
-return ll
https://github.com/llvm-beanz approved this pull request.
I have one suggested code simplification which will also require test updates,
but in general I think this is good.
https://github.com/llvm/llvm-project/pull/92704
___
cfe-commits mailing list
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/93847
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
Can you also add some tests for nested loops?
Cases like:
```hlsl
[unroll]
for( int i = 0; i < 100; ++i) { // unroll this
for( int j = 0; j < 100; ++j) { // but not this
}
}
```
https://github.com/llvm/llvm-project/pull/93879
@@ -7401,7 +7495,8 @@ b for constant buffer views (CBV).
Register space is specified in the format ``space[number]`` and defaults to
``space0`` if omitted.
Here're resource binding examples with and without space:
-.. code-block:: c++
+
+.. code-block:: hlsl
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm
-disable-llvm-passes -verify -verify-ignore-unexpected
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm
-disable-llvm-passes -verify -verify-ignore-unexpected
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/89242
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
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
Nathan =?utf-8?q?Gauër?= ,
Nathan =?utf-8?q?Gauër?=
Message-ID:
In-Reply-To:
@@ -3101,3 +3130,68 @@ CodeGenFunction::GenerateCapturedStmtFunction(const
CapturedStmt &S) {
return F;
}
+
+namespace {
+// Returns the first convergence entry/loop/anchor instruction found in
@@ -8001,6 +8001,12 @@ NamedDecl *Sema::ActOnVariableDeclarator(
}
}
+ if (getLangOpts().HLSL) {
+if (R->isHLSLSpecificType() && !NewVD->isImplicit()) {
+ Diag(D.getBeginLoc(), diag::err_hlsl_intangible_type_cannot_be_declared);
llvm-beanz wrot
llvm-beanz wrote:
Does this have any behavior change that can be tested?
https://github.com/llvm/llvm-project/pull/100778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/100778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -8001,6 +8001,12 @@ NamedDecl *Sema::ActOnVariableDeclarator(
}
}
+ if (getLangOpts().HLSL) {
+if (R->isHLSLSpecificType() && !NewVD->isImplicit()) {
+ Diag(D.getBeginLoc(), diag::err_hlsl_intangible_type_cannot_be_declared);
llvm-beanz wrot
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/101083
HLSL output parameters are denoted with the `inout` and `out` keywords in the
function declaration. When an argument to an output parameter is constructed a
temporary value is constructed for the argument.
https://github.com/llvm-beanz edited
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
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] [HLSL] Implement output parameter
HLSL output parameters ar
@@ -4057,6 +4057,10 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&OldD, Scope *S,
NewQType))
return MergeCompatibleFunctionDecls(New, Old, S, MergeTypeWithOld);
+if (getLangOpts().HLSL && Cont
@@ -4148,6 +4151,30 @@ static void emitWriteback(CodeGenFunction &CGF,
assert(!isProvablyNull(srcAddr.getBasePointer()) &&
"shouldn't have writeback for provably null argument");
+ if (CGF.getLangOpts().HLSL) {
+if (writeback.CastExpr) {
+ RValue TmpVal =
https://github.com/llvm-beanz edited
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
llvm-beanz wrote:
@etcwilde's point above is that the `CLANG_RESOURCE_DIR` is already available
in CMake for projects that import the Clang package or are built in-tree with
Clang. You can get the directory via CMake with:
```cmake
get_target_property(CLANG_IMPORT_HEADERS clang-resource-header
@@ -12361,6 +12361,21 @@ def warn_hlsl_availability_unavailable :
def err_hlsl_export_not_on_function : Error<
"export declaration can only be used on functions">;
+def err_hlsl_attribute_in_wrong_shader_model: Error<
+ "attribute %0 requires shader model %1 or greater">;
+
@@ -2862,6 +2862,10 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
else if (const auto *NT = dyn_cast(Attr))
NewAttr = S.HLSL().mergeNumThreadsAttr(D, *NT, NT->getX(), NT->getY(),
NT->getZ());
+ else if (const auto *NT
@@ -12361,6 +12361,21 @@ def warn_hlsl_availability_unavailable :
def err_hlsl_export_not_on_function : Error<
"export declaration can only be used on functions">;
+def err_hlsl_attribute_in_wrong_shader_model: Error<
+ "attribute %0 requires shader model %1 or greater">;
+
@@ -245,6 +274,18 @@ void SemaHLSL::CheckEntryPoint(FunctionDecl *FD) {
<< llvm::Triple::getEnvironmentTypeName(ST);
FD->setInvalidDecl();
}
+if (const auto *NT = FD->getAttr()) {
+ if (Ver < VersionTuple(6, 6)) {
+Diag(NT->getLocation(), di
@@ -12361,6 +12361,21 @@ def warn_hlsl_availability_unavailable :
def err_hlsl_export_not_on_function : Error<
"export declaration can only be used on functions">;
+def err_hlsl_attribute_in_wrong_shader_model: Error<
+ "attribute %0 requires shader model %1 or greater">;
+
@@ -12361,6 +12361,21 @@ def warn_hlsl_availability_unavailable :
def err_hlsl_export_not_on_function : Error<
"export declaration can only be used on functions">;
+def err_hlsl_attribute_in_wrong_shader_model: Error<
+ "attribute %0 requires shader model %1 or greater">;
+
@@ -12361,6 +12361,21 @@ def warn_hlsl_availability_unavailable :
def err_hlsl_export_not_on_function : Error<
"export declaration can only be used on functions">;
+def err_hlsl_attribute_in_wrong_shader_model: Error<
+ "attribute %0 requires shader model %1 or greater">;
+
@@ -348,6 +391,77 @@ void SemaHLSL::handleNumThreadsAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(NewAttr);
}
+void SemaHLSL::handleWaveSizeAttr(Decl *D, const ParsedAttr &AL) {
+ // validate that the wavesize argument is a power of 2 between 4 and 128
+ // inclusive
@@ -245,6 +274,18 @@ void SemaHLSL::CheckEntryPoint(FunctionDecl *FD) {
<< llvm::Triple::getEnvironmentTypeName(ST);
FD->setInvalidDecl();
}
+if (const auto *NT = FD->getAttr()) {
llvm-beanz wrote:
Why is NT the name here? That doesn't
@@ -4613,14 +4613,13 @@ def HLSLGroupSharedAddressSpace : TypeAttr {
let Documentation = [HLSLGroupSharedAddressSpaceDocs];
}
-def HLSLParamModifier : TypeAttr {
+def HLSLParamModifier : ParameterABIAttr {
llvm-beanz wrote:
DXC currently parses but ignores
@@ -5318,3 +5319,13 @@ OMPIteratorExpr *OMPIteratorExpr::CreateEmpty(const
ASTContext &Context,
alignof(OMPIteratorExpr));
return new (Mem) OMPIteratorExpr(EmptyShell(), NumIterators);
}
+
+HLSLOutArgExpr *HLSLOutArgExpr::Create(const ASTContext &C, QualType Ty,
+
@@ -4689,6 +4719,32 @@ void CodeGenFunction::EmitCallArg(CallArgList &args,
const Expr *E,
assert(type->isReferenceType() == E->isGLValue() &&
"reference binding to unmaterialized r-value!");
+ // Add writeback for HLSLOutParamExpr.
+ if (const HLSLOutArgExpr *OE
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/7] [HLSL] Implement output parameter
HLSL output parameter
https://github.com/llvm-beanz approved this pull request.
Yea, this can go. I think I had intended to use this as the underlying type for
the resource descriptor heap for dynamic resources. We can figure out a better
approach for that when we get there.
https://github.com/llvm/llvm-project/pul
@@ -0,0 +1,425 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/90553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/89788
The preprocessor define `__HLSL_ENABLE_16_BIT` should be set to 1 if native
16-bit types are enabled and not set if they are not.
Previously we were setting the value to match the HLSL active language version
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/89788
>From a44bb91986dcde7265666391c6aa46bc0876070d Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Tue, 23 Apr 2024 11:13:09 -0500
Subject: [PATCH 1/2] [HLSL] Correctly set `__HLSL_ENABLE_16_BIT`
The preproce
@@ -98,9 +100,47 @@ std::optional tryParseProfile(StringRef
Profile) {
else if (llvm::getAsUnsignedInteger(Parts[2], 0, Minor))
return std::nullopt;
- // dxil-unknown-shadermodel-hull
+ // Determine DXIL version number using the minor version number of Shader
+ // Mo
@@ -12,7 +12,10 @@
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Job.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/ErrorHandling.h"
llvm-beanz wrote:
This header should not be needed.
https://github.com/llvm/llvm-project/pu
@@ -35,6 +38,11 @@ bool isLegalShaderModel(Triple &T) {
if (Version.getSubminor())
return false;
+ // DXIL Version should be set as SubArch
+ if (T.getSubArch() == Triple::NoSubArch) {
+return false;
+ }
llvm-beanz wrote:
nit:
```suggestion
if
@@ -12,7 +12,10 @@
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Job.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/TargetParser/Triple.h"
+#include
+#include
llvm-beanz wrote:
Do we need ?
@@ -98,9 +106,46 @@ std::optional tryParseProfile(StringRef
Profile) {
else if (llvm::getAsUnsignedInteger(Parts[2], 0, Minor))
return std::nullopt;
- // dxil-unknown-shadermodel-hull
+ // Determine DXIL version number using the minor version number of Shader
+ // Mo
@@ -68,25 +68,25 @@ TEST(DxcModeTest, TargetProfileValidation) {
IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions();
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagConsumer);
- validateTargetProfile("-Tvs_6_0", "dxil--shadermodel6.0-vertex",
+ validateTargetProfile("
https://github.com/llvm-beanz approved this pull request.
I'm happy with this approach. We can adjust and iteratively address issues if
any appear.
https://github.com/llvm/llvm-project/pull/86318
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -68,25 +68,25 @@ TEST(DxcModeTest, TargetProfileValidation) {
IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions();
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagConsumer);
- validateTargetProfile("-Tvs_6_0", "dxil--shadermodel6.0-vertex",
+ validateTargetProfile("
@@ -68,25 +68,25 @@ TEST(DxcModeTest, TargetProfileValidation) {
IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions();
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagConsumer);
- validateTargetProfile("-Tvs_6_0", "dxil--shadermodel6.0-vertex",
+ validateTargetProfile("
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/89823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/89788
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz commented:
Overall I really like the direction of this. I'm curious if any of the
maintainers from Apple have thoughts since they're the primary users of
availability annotations.
I think this dramatically simplifies things for what we need, but it might also
hav
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
@@ -3859,7 +3862,7 @@ def warn_availability_fuchsia_unavailable_minor : Warning<
InGroup;
def warn_unguarded_availability :
- Warning<"%0 is only available on %1 %2 or newer">,
+ Warning<"%0 %select{is only|is not}5 available %select{|in %4 environment
}3on %1 %2 %select{
@@ -39,11 +39,44 @@ static bool isIntrinsicExpansion(Function &F) {
case Intrinsic::dx_uclamp:
case Intrinsic::dx_lerp:
case Intrinsic::dx_rcp:
+ case Intrinsic::dx_sdot:
+ case Intrinsic::dx_udot:
return true;
}
return false;
}
+static bool expandIntegerD
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/90222
This PR fixes bugs in HLSL floating conversions. HLSL always has `half`,
`float` and `double` types, which promote in the order:
`half`->`float`->`double`
and convert in the order:
`double`->`float`->`half`
@@ -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 %
llvm-beanz wrote:
> While I like the approach of aligning availability parameters closer to
> `llvm::Triple`, I am concerned about how this will interact with existing
> precedent. There is a lot of code that passes in _platform_ values that
> aren't actually `OSType`. For example
> `__attrib
@@ -7398,6 +7398,26 @@ The full documentation is available here:
https://docs.microsoft.com/en-us/windo
}];
}
+def HLSLPackOffsetDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The packoffset attribute is used to change the layout of a cbuffer.
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S
-finclude-default-header -ast-dump -x hlsl %s | FileCheck %s
+
+
+// CHECK: HLSLBufferDecl {{.*}} cbuffer A
+cbuffer A
+{
+// CHECK-NEXT: VarDecl {{.*}} C1 'float4'
+// CHECK-NEXT: HLSLP
@@ -0,0 +1,55 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.3-library -verify %s
+
+// expected-error@+1{{cannot mix packoffset elements with nonpackoffset
elements in a cbuffer}}
+cbuffer Mix
+{
+float4 M1 : packoffset(c0);
+float M2;
+
@@ -183,6 +183,86 @@ void Parser::ParseHLSLAnnotations(ParsedAttributes &Attrs,
return;
}
} break;
+ case ParsedAttr::AT_HLSLPackOffset: {
+// Parse 'packoffset( c[Subcomponent][.component] )'.
+// Check '('.
+if (ExpectAndConsume(tok::l_paren, diag::er
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple dxil-unknown-shadermodel6.3-library -S
-finclude-default-header -ast-dump -x hlsl %s | FileCheck %s
+
+
+// CHECK: HLSLBufferDecl {{.*}} cbuffer A
+cbuffer A
+{
+// CHECK-NEXT: VarDecl {{.*}} C1 'float4'
llvm-bea
@@ -7314,6 +7314,41 @@ static void handleHLSLSV_DispatchThreadIDAttr(Sema &S,
Decl *D,
D->addAttr(::new (S.Context) HLSLSV_DispatchThreadIDAttr(S.Context, AL));
}
+static void handleHLSLPackOffsetAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
+ if (!isa(D) || !isa(D->getDe
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] [HLSL] Shore up floating point conversions
This PR fixes bug
@@ -1121,3 +1121,99 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
}
return false;
}
+
+bool SemaHLSL::CheckCompatibleParameterABI(FunctionDecl *New,
+ FunctionDecl *Old) {
+ if (New->getNumPar
@@ -8511,7 +8514,7 @@ static void HandleHLSLParamModifierAttr(QualType &CurType,
return;
if (Attr.getSemanticSpelling() == HLSLParamModifierAttr::Keyword_inout ||
Attr.getSemanticSpelling() == HLSLParamModifierAttr::Keyword_out)
-CurType = S.getASTContext().getL
@@ -11427,6 +11427,19 @@ static void AnalyzeImplicitConversions(
return;
}
+ if (auto *OutArgE = dyn_cast(E)) {
+// The base expression is only used to initialize the parameter for
+// arguments to `inout` parameters, so we only traverse down the base
+// ex
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/66593
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/104474
>From a68223e1d0ee5e1b41ea7ec2385c9d581c901e70 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Thu, 15 Aug 2024 12:03:55 -0500
Subject: [PATCH 1/3] [HLSL][Doc] Document multi-argument resolution
This upd
@@ -8511,7 +8514,7 @@ static void HandleHLSLParamModifierAttr(QualType &CurType,
return;
if (Attr.getSemanticSpelling() == HLSLParamModifierAttr::Keyword_inout ||
Attr.getSemanticSpelling() == HLSLParamModifierAttr::Keyword_out)
-CurType = S.getASTContext().getL
@@ -11427,6 +11427,19 @@ static void AnalyzeImplicitConversions(
return;
}
+ if (auto *OutArgE = dyn_cast(E)) {
+// The base expression is only used to initialize the parameter for
+// arguments to `inout` parameters, so we only traverse down the base
+// ex
@@ -64,6 +64,10 @@ class SemaHLSL : public SemaBase {
// HLSL Type trait implementations
bool IsScalarizedLayoutCompatible(QualType T1, QualType T2) const;
+ bool IsIntangibleType(const QualType T1);
+
+private:
+ llvm::DenseMap IsIntangibleTypeCache;
ll
https://github.com/llvm-beanz requested changes to this pull request.
I left an inline comment about this, but rather than keeping a side map in the
SemaHLSL object we should take a bit in the RecordDecl bitfield to signify if
the type is intangible.
https://github.com/llvm/llvm-project/pull/1
https://github.com/llvm-beanz approved this pull request.
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
@@ -414,9 +414,20 @@ void CGHLSLRuntime::emitEntryFunction(const FunctionDecl
*FD,
void CGHLSLRuntime::setHLSLFunctionAttributes(const FunctionDecl *FD,
llvm::Function *Fn) {
- if (FD->isInExportDeclContext()) {
-const String
@@ -290,8 +290,6 @@ struct BuiltinTypeDeclBuilder {
SourceLocation()));
MethodDecl->setLexicalDeclContext(Record);
MethodDecl->setAccess(AccessSpecifier::AS_public);
-MethodDecl->addAttr(AlwaysInlineAttr::CreateImplicit(
https://github.com/llvm-beanz commented:
Tests?
https://github.com/llvm/llvm-project/pull/106673
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-pixel -x hlsl %s -verify
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-vertex -x hlsl %s -verify
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.8-geometry -x hlsl %s -verify
+// RUN: %clang_cc1 -triple d
@@ -357,6 +398,74 @@ void SemaHLSL::handleNumThreadsAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(NewAttr);
}
+static bool isValidWaveSizeValue(unsigned Value) {
+ return (Value >= 4 && Value <= 128 && ((Value & (Value - 1)) == 0));
llvm-beanz wrote:
301 - 400 of 932 matches
Mail list logo