https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/102227
HLSL tends to rely pretty aggressively on scalarization occuring in the
complier, which allows for some relaxed language behaviors when types are fully
sclarized to equivalent scalar representations.
This c
@@ -18660,6 +18660,10 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
llvm::FunctionType::get(IntTy, {}, false),
"__hlsl_wave_get_lane_index",
{}, false, true));
}
+ case Builtin::BI__builtin_hlsl_wave_is_first_lane: {
+Intrinsic::ID ID = CGM.getH
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
}
return false;
}
+
+static void BuildFlattenedTypeList(QualType BaseTy,
+ llvm::SmallVectorImpl &List) {
+ llvm::SmallVector WorkList
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/104844
HLSL allows implicit conversions to truncate vectors to scalar pr-values. These
conversions are scored as vector truncations and should warn appropriately.
This change allows forming a truncation cast to a p
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/102227
___
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 01/10] [HLSL] Implement output parameter
HLSL output paramet
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/102227
___
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/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/3] [HLSL] Rework implicit conversion sequences
This PR rewo
https://github.com/llvm-beanz approved this pull request.
HLSL changes look good to me.
https://github.com/llvm/llvm-project/pull/96641
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -o - %s
-verify
+
+// expected-no-diagnostics
+
+struct MyBitFields {
+unsigned int field1 : 3; // 3 bits for field1
+unsigned int field2 : 4; // 4 bits for field2
+int field3 : 5;
@@ -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
llvm-beanz wrote:
> The grammer looks exactly the same with modules. May it be compatible with
> modules?
The grammar is the same (although HLSL only supports the `export` keyword in a
subset of the places C++ does), but the behavior isn't the same. We may look to
shift HLSL's behavior to mat
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/104844
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,42 @@
+//===- hlsl_intrinsics.h - HLSL definitions for intrinsics --===//
+//
+// 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: Apache
llvm-beanz wrote:
> Can we test this?
It is tested. The modified test case adds a run line with `-std=hlsl202x` which
fails without this change due to narrowing conversion in an initializer list.
https://github.com/llvm/llvm-project/pull/108035
___
c
llvm-beanz wrote:
> looks fine. Curious, why is this extra RUN: line added? Doesn't the other one
> already contain the same parameters `-ast-dump -o - %s | FileCheck %s` ?
>
> RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -ast-dump -o - %s |
> FileCheck %s
The diff is a bit awkward
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/108035
___
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/108437
This change adds a new HLSL 202y language mode. Currently HLSL 202y is planned
to add `auto` and `constexpr`.
This change updates extension diagnostics to state that lambadas are a "clang
HLSL" extension (s
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/108445
Under HLSL 202x+ move assignment can occur and when targeting `this` move
assignment was generating some really odd errors. This corrects the errors by
properly generating the `this` object reference for HLS
@@ -2502,9 +2505,16 @@ void
CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
ShouldAddOptNone &= !D->hasAttr();
ShouldAddOptNone &= !D->hasAttr();
- // Add optnone, but do so only if the function isn't always_inline.
- if ((ShouldAddOptNone || D->has
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -emit-llvm-only %s
-verify
llvm-beanz wrote:
We should not need to emit IR to test a warning. This should work with
`-fsyntax-only` or without the `-emit-llvm-only` flag.
https://githu
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/107176
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,18 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only
-disable-llvm-passes -verify -verify-ignore-unexpected
llvm-beanz wrote:
what messages are seen but not expected?
https:/
@@ -12397,6 +12397,9 @@ def warn_attr_min_eq_max: Warning<
def err_hlsl_attribute_number_arguments_insufficient_shader_model: Error<
"attribute %0 with %1 arguments requires shader model %2 or greater">;
+def ext_hlsl_auto_type_specifier : ExtWarn<
llvm-bea
@@ -12397,6 +12397,9 @@ def warn_attr_min_eq_max: Warning<
def err_hlsl_attribute_number_arguments_insufficient_shader_model: Error<
"attribute %0 with %1 arguments requires shader model %2 or greater">;
+def ext_hlsl_auto_type_specifier : ExtWarn<
+ "'auto' type specifier
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/108437
>From 34cc492bad3f1b2b4cae7eb4dc5cbd4b219a8944 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Tue, 10 Sep 2024 10:24:08 -0500
Subject: [PATCH 1/2] [HLSL] Add HLSL 202y language mode
This change adds a n
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/108445
>From a5be65fa3b763659dda7fd9ab2fda9ca9dae4391 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Thu, 12 Sep 2024 12:06:02 -0500
Subject: [PATCH 1/2] [HLSL] Fix move assignment of `this`
Under HLSL 202x+ m
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/108445
___
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/108659
HLSL has a different set of usual arithmetic conversions for vector types to
resolve a common type for binary operator expressions.
This PR implements the current spec proposal from:
https://github.com/micr
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/108662
As captured in issue #108044, HLSL 202x is the target language mode for
conformance for Clang. Earlier language modes will be a best effort and
prioritized after 2020x. To make this easier and reduce our tes
@@ -361,6 +361,23 @@ bool any(double3);
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_any)
bool any(double4);
+//===--===//
+// asfloat builtins
+//===-
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/108662
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -12,7 +12,7 @@
// HALF: #define __HLSL_ENABLE_16_BIT 1
// NOHALF-NOT: __HLSL_ENABLE_16_BIT
-// CHECK: #define __HLSL_VERSION 2021
+// CHECK: #define __HLSL_VERSION 2028
llvm-beanz wrote:
202x doesn't have a year yet, so to make it big and far out I gave it
@@ -12,7 +12,7 @@
// HALF: #define __HLSL_ENABLE_16_BIT 1
// NOHALF-NOT: __HLSL_ENABLE_16_BIT
-// CHECK: #define __HLSL_VERSION 2021
+// CHECK: #define __HLSL_VERSION 2028
llvm-beanz wrote:
Yea. Subject to revision once we have an actual year.
https://github
@@ -37,7 +37,7 @@ _Static_assert(is_same<__decltype(4294967296),
int64_t>::value, "4294967296 is i
// Clang emits a warning that it is interpreting it as unsigned because that is
// not conforming to the C standard.
-// expected-warning@+1{{integer literal is too large to be
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/108662
___
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/108894
This adds a warning about incomplete language mode support before HLSL 202x.
This is the last change in the sequence to fix and make HLSL 202x the default
mode for Clang (#108044).
Fixes #108044
>From 0b5
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/108902
This marks the `bit_cast` helper as `constexpr` and allows the casts
implemented with it to also be `constexpr`. This is largely not a functional
change, but it enables using the casts in expressions that ne
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/108902
>From 9deebd707410a6ad8474f615a97c943937ceeb34 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Mon, 16 Sep 2024 18:21:38 -0500
Subject: [PATCH 1/2] [HLSL] Make casting functions constexpr
This marks the
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/110327
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -32,6 +32,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/CRC.h"
+#include "llvm/Support/DXILABI.h"
llvm-beanz wrote:
Do we need this include?
https://github.com/llvm/llvm-project/pull/110327
___
@@ -3437,6 +3437,9 @@ static void encodeTypeForFunctionPointerAuth(const
ASTContext &Ctx,
OS << II->getLength() << II->getName();
return;
}
+ case Type::HLSLAttributedResource:
llvm-beanz wrote:
This should maybe be higher up with the "should never
@@ -3943,6 +3943,9 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type
*Ty) {
// abi::__pointer_to_member_type_info.
VTableName = "_ZTVN10__cxxabiv129__pointer_to_member_type_infoE";
break;
+
+ case Type::HLSLAttributedResource:
+llvm_unreachable("not ye
@@ -4205,6 +4208,9 @@ llvm::Constant *ItaniumRTTIBuilder::BuildTypeInfo(
case Type::Atomic:
// No fields, at least for the moment.
break;
+
+ case Type::HLSLAttributedResource:
+llvm_unreachable("not yet implemented");
llvm-beanz wrote:
This too
https://github.com/llvm-beanz commented:
A few (mostly small) comments
https://github.com/llvm/llvm-project/pull/110327
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -13672,6 +13690,9 @@ static QualType getCommonNonSugarTypeNode(ASTContext
&Ctx, const Type *X,
TX->getDepth(), TX->getIndex(), TX->isParameterPack(),
getCommonDecl(TX->getDecl(), TY->getDecl()));
}
+ case Type::HLSLAttributedResource: {
l
@@ -29,19 +29,40 @@ class DirectXTargetCodeGenInfo : public TargetCodeGenInfo {
llvm::Type *DirectXTargetCodeGenInfo::getHLSLType(CodeGenModule &CGM,
const Type *Ty) const {
- auto *BuiltinTy = dyn_cast(Ty);
- if (!BuiltinTy
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only
-disable-llvm-passes -verify -verify-ignore-unexpected
llvm-beanz wrote:
I'm always suspicious when I see `verify-ignore-u
@@ -87,6 +87,7 @@ class CGHLSLRuntime {
GENERATE_HLSL_INTRINSIC_FUNCTION(SDot, sdot)
GENERATE_HLSL_INTRINSIC_FUNCTION(UDot, udot)
GENERATE_HLSL_INTRINSIC_FUNCTION(WaveIsFirstLane, wave_is_first_lane)
+ GENERATE_HLSL_INTRINSIC_FUNCTION(WaveReadLaneAt, waveReadLaneAt)
@@ -18835,6 +18835,24 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
Intrinsic::ID ID = CGM.getHLSLRuntime().getWaveIsFirstLaneIntrinsic();
return EmitRuntimeCall(Intrinsic::getDeclaration(&CGM.getModule(), ID));
}
+ case Builtin::BI__builtin_hlsl_wave_read_l
@@ -2249,6 +2235,25 @@ static bool IsStandardConversion(Sema &S, Expr* From,
QualType ToType,
SCS.setAllToTypes(ToType);
return true;
+ } else if (argIsLValue && !FromType->canDecayToPointerType() &&
+ S.Context.getCanonicalType(FromType) != S.Context.Ove
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
https://github.com/llvm-beanz commented:
I've got a lot of style nits here.
In general it is nice to break up changes into smaller changes where you can.
One obvious split in this PR would have been to put the DirectX backend changes
in first in a separate PR.
Smaller PRs are easier to review
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
@@ -1992,6 +2001,37 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_splitdouble: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+Expr *Op0 = TheCall
@@ -1992,6 +2001,37 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_splitdouble: {
+if (SemaRef.checkArgCount(TheCall, 3))
+ return true;
+
+Expr *Op0 = TheCall
@@ -4681,6 +4681,11 @@ void CallArg::copyInto(CodeGenFunction &CGF, Address
Addr) const {
IsUsed = true;
}
+void CodeGenFunction::EmitWritebacks(CodeGenFunction &CGF,
+ const CallArgList &args) {
+ emitWritebacks(CGF, args);
@@ -5148,6 +5151,9 @@ class CodeGenFunction : public CodeGenTypeCache {
SourceLocation ArgLoc, AbstractCallee AC,
unsigned ParmNum);
+ /// EmitWriteback - Emit callbacks for function.
+ void EmitWritebacks(CodeGenFunction
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
@@ -18901,6 +18901,150 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
CGM.getHLSLRuntime().getRadiansIntrinsic(), ArrayRef{Op0},
nullptr, "hlsl.radians");
}
+ // This should only be called when targeting DXIL
+ case Builtin::BI__builtin_hlsl_splitdou
@@ -17,12 +17,12 @@ void add(sx10x10_t a, sx5x10_t b, sx10x5_t c) {
// expected-error@-1 {{assigning to 'sx10x10_t' (aka 'float
__attribute__((matrix_type(10, 10)))') from incompatible type 'sx5x10_t' (aka
'float __attribute__((matrix_type(5, 10)))')}}
a = b + &c;
- //
@@ -87,6 +87,7 @@ class CGHLSLRuntime {
GENERATE_HLSL_INTRINSIC_FUNCTION(SDot, sdot)
GENERATE_HLSL_INTRINSIC_FUNCTION(UDot, udot)
GENERATE_HLSL_INTRINSIC_FUNCTION(WaveIsFirstLane, wave_is_first_lane)
+ GENERATE_HLSL_INTRINSIC_FUNCTION(WaveReadLaneAt, waveReadLaneAt)
@@ -87,6 +87,7 @@ class CGHLSLRuntime {
GENERATE_HLSL_INTRINSIC_FUNCTION(SDot, sdot)
GENERATE_HLSL_INTRINSIC_FUNCTION(UDot, udot)
GENERATE_HLSL_INTRINSIC_FUNCTION(WaveIsFirstLane, wave_is_first_lane)
+ GENERATE_HLSL_INTRINSIC_FUNCTION(WaveReadLaneAt, waveReadLaneAt)
@@ -852,34 +852,50 @@ void TypePrinter::printExtVectorAfter(const ExtVectorType
*T, raw_ostream &OS) {
void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T,
raw_ostream &OS) {
+ if (Policy.UseHLSLTypes)
+OS <
@@ -4690,8 +4690,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args,
const Expr *E,
return emitWritebackArg(*this, args, CRE);
}
- assert(type->isReferenceType() == E->isGLValue() &&
- "reference binding to unmaterialized r-value!");
+ assert(type->isArr
@@ -5811,9 +5811,12 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const
BinaryOperator *E) {
// This function implements trivial copy assignment for HLSL's
// assignable constant arrays.
LValue CodeGenFunction::EmitHLSLArrayAssignLValue(const BinaryOperator *E) {
- LVal
@@ -1956,6 +1956,26 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_wave_read_lane_at: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+
+// Ensure ind
@@ -2015,6 +2015,13 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_is_first_lane)
__attribute__((convergent)) bool WaveIsFirstLane();
+// \brief Returns the value of the expression for the given lane index within
+// the specified wave.
+templa
@@ -18835,6 +18835,24 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
Intrinsic::ID ID = CGM.getHLSLRuntime().getWaveIsFirstLaneIntrinsic();
return EmitRuntimeCall(Intrinsic::getDeclaration(&CGM.getModule(), ID));
}
+ case Builtin::BI__builtin_hlsl_wave_read_l
@@ -3830,6 +3830,16 @@ QualType ASTContext::getDecayedType(QualType T) const {
return getDecayedType(T, Decayed);
}
+QualType ASTContext::getConstantArrayFromArrayParameterType(QualType Ty) const
{
+ if (Ty->isConstantArrayType() && !Ty->isArrayParameterType())
+return
@@ -2015,6 +2015,13 @@ _HLSL_AVAILABILITY(shadermodel, 6.0)
_HLSL_BUILTIN_ALIAS(__builtin_hlsl_wave_is_first_lane)
__attribute__((convergent)) bool WaveIsFirstLane();
+// \brief Returns the value of the expression for the given lane index within
+// the specified wave.
+templa
@@ -483,10 +555,106 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *getSizeOfLEQ16Expr(clang::ASTContext &context,
+ SourceLocation NameLoc,
+
@@ -323,30 +324,101 @@ struct TemplateParameterListBuilder {
S.Context, Builder.Record->getDeclContext(), SourceLocation(),
SourceLocation(), /* TemplateDepth */ 0, Position,
&S.Context.Idents.get(Name, tok::TokenKind::identifier),
-/* Typename *
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/111010
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1956,6 +1956,26 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
return true;
break;
}
+ case Builtin::BI__builtin_hlsl_wave_read_lane_at: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+
+// Ensure ind
@@ -1381,7 +1381,7 @@ void ASTContext::InitBuiltinTypes(const TargetInfo
&Target,
if (LangOpts.OpenACC && !LangOpts.OpenMP) {
InitBuiltinType(ArraySectionTy, BuiltinType::ArraySection);
}
- if (LangOpts.MatrixTypes)
+ if (LangOpts.MatrixTypes || LangOpts.HLSL)
--
https://github.com/llvm-beanz commented:
One small nit, but otherwise looks good.
https://github.com/llvm/llvm-project/pull/111010
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -87,6 +87,7 @@ class CGHLSLRuntime {
GENERATE_HLSL_INTRINSIC_FUNCTION(SDot, sdot)
GENERATE_HLSL_INTRINSIC_FUNCTION(UDot, udot)
GENERATE_HLSL_INTRINSIC_FUNCTION(WaveIsFirstLane, wave_is_first_lane)
+ GENERATE_HLSL_INTRINSIC_FUNCTION(WaveReadLaneAt, wave_readlaneat)
---
@@ -359,6 +356,176 @@ struct TemplateParameterListBuilder {
return Builder;
}
};
+
+// Builder for methods of builtin types. Allows adding methods to builtin types
+// using the builder pattern like this:
+//
+// BuiltinTypeMethodBuilder(Sema, RecordBuilder, "MethodName
@@ -359,6 +356,176 @@ struct TemplateParameterListBuilder {
return Builder;
}
};
+
+// Builder for methods of builtin types. Allows adding methods to builtin types
+// using the builder pattern like this:
+//
+// BuiltinTypeMethodBuilder(Sema, RecordBuilder, "MethodName
@@ -2163,6 +2163,50 @@ static void BuildFlattenedTypeList(QualType BaseTy,
}
}
+bool SemaHLSL::IsTypedResourceElementCompatible(clang::QualType QT) {
+ if (QT.isNull())
+return false;
+
+ // check if the outer type was an array type
+ if (QT->isArrayType())
+retur
@@ -15,7 +15,7 @@
// EMPTY-NEXT: CXXRecordDecl 0x{{[0-9A-Fa-f]+}} <> implicit class RWBuffer
// EMPTY-NEXT: FinalAttr 0x{{[0-9A-Fa-f]+}} <> Implicit final
-// There should be no more occurrances of RWBuffer
+// There should be no more occurrences of RWBuffer
@@ -354,27 +345,230 @@ struct TemplateParameterListBuilder {
Params.clear();
QualType T = Builder.Template->getInjectedClassNameSpecialization();
-T = S.Context.getInjectedClassNameType(Builder.Record, T);
+T = AST.getInjectedClassNameType(Builder.Record, T);
@@ -354,27 +345,230 @@ struct TemplateParameterListBuilder {
Params.clear();
QualType T = Builder.Template->getInjectedClassNameSpecialization();
-T = S.Context.getInjectedClassNameType(Builder.Record, T);
+T = AST.getInjectedClassNameType(Builder.Record, T);
https://github.com/llvm-beanz approved this pull request.
A couple small comment take or leave, but looks good.
https://github.com/llvm/llvm-project/pull/114148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mail
@@ -4846,7 +4846,6 @@ def HLSLSaturate : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
-
llvm-beanz wrote:
nit: looks like an unrelated change from a merge conflict.
https://github.com/llvm/llvm-project/pull/114148
_
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/114148
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -483,10 +581,102 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *constructSizeOfLEQ16Expr(ASTContext &Context,
+ SourceLocation NameLoc,
+
@@ -483,10 +581,102 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *constructSizeOfLEQ16Expr(ASTContext &Context,
+ SourceLocation NameLoc,
+
https://github.com/llvm-beanz commented:
Mostly looking good to me. A few small comments.
https://github.com/llvm/llvm-project/pull/112600
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/112600
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -483,10 +581,102 @@ static BuiltinTypeDeclBuilder
setupBufferType(CXXRecordDecl *Decl, Sema &S,
.addDefaultHandleConstructor(S, RC);
}
+BinaryOperator *constructSizeOfLEQ16Expr(ASTContext &Context,
+ SourceLocation NameLoc,
+
@@ -0,0 +1,134 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -disable-llvm-passes
-emit-llvm -finclude-default-header -o - %s | FileCheck %s
+
+// CHECK-LABEL: increment
+void increment(inout int Arr[2]) {
+ for (int I = 0; I < 2; I++)
+Arr[0] += 2;
+}
+
+//
@@ -1,7 +1,5 @@
// RUN: %clang_cc1 -O0 -fenable-matrix -triple x86_64-apple-darwin %s
-emit-llvm -disable-llvm-passes -o - -std=c++11 | FileCheck
--check-prefixes=CHECK,NOOPT %s
// RUN: %clang_cc1 -O1 -fenable-matrix -triple x86_64-apple-darwin %s
-emit-llvm -disable-llvm-pas
501 - 600 of 997 matches
Mail list logo