https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/118569
___
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.
This mostly looks good to me. I have a few style nits to use more idomatic
patterns and conform better to LLVM coding standards.
https://github.com/llvm/llvm-project/pull/118569
___
cfe-commits
@@ -761,7 +762,37 @@ void StoreDiags::HandleDiagnostic(DiagnosticsEngine::Level
DiagLevel,
return false;
if (!isInsideMainFile(FixIt.RemoveRange.getBegin(), SM))
return false;
- Edits.push_back(toTextEdit(FixIt, SM, *LangOpts));
+
+ auto R = too
@@ -149,26 +149,12 @@ class ErrorReporter {
Repl.getLength(),
Repl.getReplacementText());
auto &Entry = FileReplacements[R.getFilePath()];
Replacements &Replacements = Entry.Replaces;
-llvm::Error Err = Rep
@@ -342,6 +342,20 @@ llvm::Error Replacements::add(const Replacement &R) {
return llvm::Error::success();
}
+llvm::Error Replacements::addOrMerge(const Replacement &R) {
+ auto Err = add(R);
+ if (Err) {
llvm-beanz wrote:
nit: You could rewrite this as:
`
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/122105
___
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/119820
___
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/122105
#116331 introduced a regression in DXIL testing, and did not address all PR
feedback before merging. @joaosaffran is looking at the regression tracked in
#122052 and will re-land these changes with that fix
@@ -8010,15 +8010,19 @@ void Clang::ConstructJob(Compilation &C, const
JobAction &JA,
}
}
- if (Args.hasArg(options::OPT_forder_file_instrumentation)) {
- CmdArgs.push_back("-forder-file-instrumentation");
- // Enable order file instrumentation when ThinLTO is
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/122157
___
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/122337
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
> No failures. We would need to have tests for all intrinsics that if its not
> SM 6.2 or greater uses of half would error, but we never did that for any of
> the other intrinsics so we should probably discuss what the test coverage
> should be and apply it broadly.
In pract
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -253,12 +257,229 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
@@ -0,0 +1,96 @@
+//===--- ParseHLSLRootSignature.h ---*- C++
-*-===//
+//
+// 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
llvm-beanz wrote:
As I said in your other PR, I believe not including error reporting and the
appropriate testing makes it significantly more difficult to review the
subsequent commit since not all the appropriate code will even be in the PR.
https://github.c
@@ -0,0 +1,133 @@
+//=== ParseHLSLRootSignatureTest.cpp - Parse Root Signature tests
-===//
+//
+// 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: Ap
@@ -1461,6 +1552,7 @@ static bool castPreservesZero(const CastExpr *CE) {
case CK_NonAtomicToAtomic:
case CK_AtomicToNonAtomic:
case CK_HLSLVectorTruncation:
+ case CK_HLSLAggregateCast: // TODO does CK_HLSLAggregateCast preserve zero?
llvm-beanz wrote:
@@ -707,6 +707,7 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
case CK_ToVoid:
case CK_NonAtomicToAtomic:
case CK_HLSLArrayRValue:
+case CK_HLSLAggregateCast:
llvm-beanz wrote:
Nope, this cast should not ever be implicit.
https:/
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/122202
___
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:
We talked about this yesterday in a call with @Keenuts and @s-perron.
I think one of the problems we have with HLSL is that we haven't had explicit
address space annotations except for `groupshared` in the past. We do need to
do that in the future, but
https://github.com/llvm-beanz commented:
The one design question I have here is: should we be bothering to create a
handle for the cbuffer in the frontend at all?
My thought had been that we would instead emit the cbuffer member declarations
as constant address space (2 for DXIL) declarations
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/122820
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -253,12 +257,253 @@ static void validatePackoffset(Sema &S, HLSLBufferDecl
*BufDecl) {
}
}
+// Returns true if the array has a zero size = if any of the dimensions is 0
+static bool isZeroSizedArray(const ConstantArrayType *CAT) {
+ while (CAT && !CAT->isZeroSize())
+
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/116858
___
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/118569
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2752,7 +2787,17 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) {
llvm::Value *Zero = llvm::Constant::getNullValue(CGF.SizeTy);
return Builder.CreateExtractElement(Vec, Zero, "cast.vtrunc");
}
+ case CK_HLSLAggregateCast: {
+RValue RV = CGF.EmitAnyEx
@@ -491,6 +491,81 @@ static bool isTrivialFiller(Expr *E) {
return false;
}
+// emit a flat cast where the RHS is a scalar, including vector
+static void EmitHLSLScalarFlatCast(CodeGenFunction &CGF, Address DestVal,
+ QualType DestTy, llvm::
@@ -6358,3 +6359,89 @@ RValue CodeGenFunction::EmitPseudoObjectRValue(const
PseudoObjectExpr *E,
LValue CodeGenFunction::EmitPseudoObjectLValue(const PseudoObjectExpr *E) {
return emitPseudoObjectExpr(*this, E, true, AggValueSlot::ignored()).LV;
}
+
+void CodeGenFunction::Fl
@@ -2412,6 +2412,102 @@ bool SemaHLSL::CheckCompatibleParameterABI(FunctionDecl
*New,
return HadError;
}
+// Generally follows PerformScalarCast, with cases reordered for
+// clarity of what types are supported
+bool SemaHLSL::CanPerformScalarCast(QualType SrcTy, QualType D
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/118842
___
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:
I want to spend a little more time going over the tests, but I had a few small
comments. This seems to be mostly right from my initial review.
https://github.com/llvm/llvm-project/pull/118842
___
cfe-commits ma
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/123141
This PR implements HLSL's initialization list behvaior as specified in the
draft language specifcation under
[*Decl.Init.Agg*](https://microsoft.github.io/hlsl-specs/specs/hlsl.html
#Decl.Init.Agg).
This be
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2412,6 +2412,102 @@ bool SemaHLSL::CheckCompatibleParameterABI(FunctionDecl
*New,
return HadError;
}
+// Generally follows PerformScalarCast, with cases reordered for
+// clarity of what types are supported
+bool SemaHLSL::CanPerformScalarCast(QualType SrcTy, QualType D
llvm-beanz wrote:
> I was kind of hoping we might be able to generate the accesses off a handle
> during codegen when the global is accessed. I'm not sure if that's possible
> though.
I'm concerned that this will be more complex to make work with the other CBV
syntaxes. For example, the impli
llvm-beanz wrote:
A couple notes for myself:
* I need to write some AST tests
* Also need to write tests to cover bit fields and unions.
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://li
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/122977
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvm-beanz wrote:
> > How does it not duplicate sub-expressions while also not creating temporary
> > variables to capture results?
>
> The way I thought of to comprehensively solve this in a clear general way was
> to:
>
> * create a new temporary with an anonymous struct type containing the
@@ -0,0 +1,166 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#126565): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
@@ -2804,6 +2804,42 @@ bool SemaHLSL::ContainsBitField(QualType BaseTy) {
return false;
}
+// Can perform an HLSL splat cast if the Dest is an aggregate and the
+// Src is a scalar or a vector of length 1
+// Or if Dest is a vector and Src is a vector of length 1
+bool SemaH
@@ -370,6 +370,9 @@ CAST_OPERATION(HLSLArrayRValue)
// Aggregate by Value cast (HLSL only).
CAST_OPERATION(HLSLElementwiseCast)
+// Splat cast for Aggregates (HLSL only).
+CAST_OPERATION(HLSLSplatCast)
llvm-beanz wrote:
nit: can we call this `HLSLAggregateSpl
@@ -2245,6 +2245,17 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -finclude-default-header -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s \
+// RUN: -emit-llvm -O1 -verify
+
+bool test_too_few_arg(bool a) {
+ return __builtin_hlsl_and(a);
+ // expected-error@-1 {{too few arguments to function call
@@ -1730,6 +1731,16 @@ void AggExprEmitter::VisitCXXParenListOrInitListExpr(
}
#endif
+ // HLSL initialization lists in the AST are an expansion which can contain
+ // side-effecting expressions wrapped in opaque value expressions. To
properly
+ // emit these we need to
@@ -1462,6 +1462,14 @@ void CXXRecordDecl::addedMember(Decl *D) {
if (Using->getDeclName().getCXXOverloadedOperator() == OO_Equal)
data().HasInheritedAssignment = true;
}
+
+ // HLSL: All user-defined data types are aggregates and use aggregate
+ // initialization
@@ -2229,6 +2241,41 @@ static bool CheckResourceHandle(
// returning an ExprError
bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
{
switch (BuiltinID) {
+ case Builtin::BI__builtin_hlsl_adduint64: {
+if (SemaRef.checkArgCount(TheCall, 2))
@@ -10655,6 +10655,8 @@ def err_second_argument_to_cwsc_not_pointer : Error<
def err_vector_incorrect_num_elements : Error<
"%select{too many|too few}0 elements in vector
%select{initialization|operand}3 (expected %1 elements, have %2)">;
+def err_invalid_even_odd_vector_el
@@ -2229,6 +2241,41 @@ static bool CheckResourceHandle(
// returning an ExprError
bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
{
switch (BuiltinID) {
+ case Builtin::BI__builtin_hlsl_adduint64: {
+if (SemaRef.checkArgCount(TheCall, 2))
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/123977
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2064,6 +2064,9 @@ llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value
*Value, QualType Ty) {
if (Ty->isExtVectorBoolType()) {
llvm::Type *StoreTy = convertTypeForLoadStore(Ty, Value->getType());
+if (getLangOpts().HLSL)
llvm-beanz wrote:
Do
https://github.com/llvm-beanz commented:
I commented on the first two that I saw, but I think there are a lot of places
left where you're conditionalizing the CodeGen behavior on HLSL, that we could
instead make the condition based on the types involved requiring conversions.
https://github.co
@@ -2081,6 +2084,9 @@ llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value
*Value, QualType Ty) {
llvm::Value *CodeGenFunction::EmitFromMemory(llvm::Value *Value, QualType Ty) {
if (Ty->isExtVectorBoolType()) {
const auto *RawIntTy = Value->getType();
+if (getLangO
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/127098
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2245,6 +2245,17 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
@@ -3173,9 +3173,18 @@ bool SemaHLSL::TransformInitList(const InitializedEntity
&Entity,
BuildFlattenedTypeList(InitTy, DestTypes);
llvm::SmallVector ArgExprs;
- for (Expr *Arg : Init->inits())
-if (!BuildInitializerList(SemaRef, Ctx, Arg, ArgExprs, DestTypes))
+ fo
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/127346
This PR disallows virtual inheritance and virtual functions in HLSL.
>From e62dc4bfc4f1cff2a624caf70fcc7bb0dc4a6236 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Sat, 15 Feb 2025 14:34:05 -0600
Subject
https://github.com/llvm-beanz updated
https://github.com/llvm/llvm-project/pull/127346
>From e62dc4bfc4f1cff2a624caf70fcc7bb0dc4a6236 Mon Sep 17 00:00:00 2001
From: Chris Bieneman
Date: Sat, 15 Feb 2025 14:34:05 -0600
Subject: [PATCH 1/2] [HLSL] Disallow virtual inheritance and functions
This
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/127098
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
@@ -2576,3 +2576,162 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl
*VD) {
}
}
}
+
+static bool CastInitializer(Sema &S, ASTContext &Ctx, Expr *E,
+llvm::SmallVectorImpl &List,
+llvm::SmallVectorImpl &DestT
llvm-beanz wrote:
I did find a bug in this for handling data structures with resources... I'm
working on it and will update the PR when I have a fix.
https://github.com/llvm/llvm-project/pull/123141
___
cfe-commits mailing list
cfe-commits@lists.llvm.
@@ -2245,6 +2245,17 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
@@ -2079,6 +2079,14 @@ static bool CheckFloatingOrIntRepresentation(Sema *S,
CallExpr *TheCall) {
checkAllSignedTypes);
}
+static bool CheckBoolRepresentation(Sema *S, CallExpr *TheCall) {
+ auto checkAllBoolTypes = [](clang::QualType Pass
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/123141
___
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.
One small formatting cleanup in a suggestion. LGTM.
https://github.com/llvm/llvm-project/pull/122981
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
@@ -0,0 +1,124 @@
+//===--- HLSLRootSignature.def - Tokens and Enum Database ---*- C++
-*-===//
+
+//
llvm-beanz wrote:
nit:
```suggestion
//
```
https://github.com/llvm/llvm-project/pull/122981
___
cfe-commits ma
@@ -4931,7 +4931,9 @@ static TypeSourceInfo
*GetFullTypeForDeclarator(TypeProcessingState &state,
// C99 6.7.5.3p1: The return type may not be a function or array type.
// For conversion functions, we'll diagnose this particular error later.
- if (!D.isInvali
@@ -2527,7 +2527,7 @@ QualType Sema::BuildMatrixType(QualType ElementTy, Expr
*NumRows, Expr *NumCols,
}
bool Sema::CheckFunctionReturnType(QualType T, SourceLocation Loc) {
- if (T->isArrayType() || T->isFunctionType()) {
+ if ((!getLangOpts().HLSL && T->isArrayType()) ||
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/122981
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,89 @@
+//===--- ParseHLSLRootSignature.h ---*- C++
-*-===//
+//
+// 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 commented:
My last real question here is whether this belongs in clang/Parse or if it
should be in clang/Lex. Since it is now strictly Lexing it shouldn't have any
dependencies on the parse or AST libraries right?
https://github.com/llvm/llvm-project/pull/122981
_
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/122981
___
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/118992
___
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/106860
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,194 @@
+#include "clang/Parse/ParseHLSLRootSignature.h"
+
+namespace clang {
+namespace hlsl {
+
+// Lexer Definitions
+
+static bool IsNumberChar(char C) {
+ // TODO(#126565): extend for float support exponents
+ return isdigit(C); // integer support
+}
+
+bool RootS
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
https://github.com/llvm-beanz edited
https://github.com/llvm/llvm-project/pull/127098
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
@@ -0,0 +1,30 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - -Wstack-exhausted
llvm-beanz wrote:
What if rather than removing the test we just add a `REQUIRES: slow_tests`
line, and have a CMake option to enable the "slow_tests" feature?
That would be a really small
https://github.com/llvm-beanz created
https://github.com/llvm/llvm-project/pull/128257
This seems silly, but DXC supports unsigned integer versions of abs that are
just no-ops. This adds the overloads for source compatability because
apparently users actually use them...
Fixes #128249
>From
https://github.com/llvm-beanz approved this pull request.
https://github.com/llvm/llvm-project/pull/128246
___
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/128250
We do handle EmptyDecls in codegen already as of #124886, but we were blocking
them in Sema. EmptyDecls tend to be caused by extra semicolons which are not
illegal.
Fixes #128238
>From 98d8a84c508d743cb366
https://github.com/llvm-beanz approved this pull request.
Looks reasonable to me, sorry for the review delay.
https://github.com/llvm/llvm-project/pull/121515
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
@@ -2803,6 +2803,10 @@ class ASTContext : public RefCountedBase {
return getUnqualifiedArrayType(T, Quals);
}
+ // Determine whether an array is a valid return type
+ // Array is a valid return type for HLSL
+ bool isReturnableArrayType() const { return getLangOpts().
@@ -20760,7 +20761,8 @@ ExprResult
RebuildUnknownAnyExpr::VisitCallExpr(CallExpr *E) {
ExprResult RebuildUnknownAnyExpr::VisitObjCMessageExpr(ObjCMessageExpr *E) {
// Verify that this is a legal result type of a call.
- if (DestType->isArrayType() || DestType->isFunctionTy
@@ -2803,6 +2803,10 @@ class ASTContext : public RefCountedBase {
return getUnqualifiedArrayType(T, Quals);
}
+ // Determine whether an array is a valid return type
+ // Array is a valid return type for HLSL
+ bool isReturnableArrayType() const { return getLangOpts().
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/128047
___
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.
Looks reasonable
https://github.com/llvm/llvm-project/pull/127896
___
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/128894
If you have zlib (not standard) on Windows, this test runs, and it was missing
a match for the file extension on lld.
>From da4f0de19daaed0a30b3dfe985e6920e89a07c7d Mon Sep 17 00:00:00 2001
From: Chris B
Da
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/128250
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -94,3 +122,60 @@ double3 test_abs_double3(double3 p0) { return abs(p0); }
// CHECK-LABEL: define noundef nofpclass(nan inf) <4 x double>
@_Z16test_abs_double4
// CHECK: call reassoc nnan ninf nsz arcp afn <4 x double> @llvm.fabs.v4f64(
double4 test_abs_double4(double4 p0) {
https://github.com/llvm-beanz closed
https://github.com/llvm/llvm-project/pull/128257
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -14017,6 +14017,24 @@ void Sema::CheckCastAlign(Expr *Op, QualType T,
SourceRange TRange) {
<< TRange << Op->getSourceRange();
}
+void Sema::CheckVectorAccess(const Expr *BaseExpr, const Expr *IndexExpr) {
+ const VectorType *VTy = BaseExpr->getType()->getAs();
+ if
@@ -2245,6 +2245,36 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned
BuiltinID, CallExpr *TheCall) {
break;
}
+ case Builtin::BI__builtin_hlsl_and: {
+if (SemaRef.checkArgCount(TheCall, 2))
+ return true;
+if (CheckVectorElementCallArgs(&SemaRef, TheCal
llvm-beanz wrote:
For this issue I think there is a clear path forward to use the utilities that
the `__builtin_hlsl_select` builtin uses to validate its arguments. I've filed
https://github.com/llvm/llvm-project/issues/127512 to revisit all the other
builtins that are using the pattern which
@@ -6585,6 +6585,18 @@ void InitializationSequence::InitializeFrom(Sema &S,
}
}
+if (S.getLangOpts().HLSL && Initializer && isa(DestAT))
{
llvm-beanz wrote:
Looking at this a bit. `canPerformArrayCopy` fails in cases that would
otherwise be va
801 - 900 of 932 matches
Mail list logo