@@ -2016,8 +2016,9 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const
{
case Type::Vector: {
const auto *VT = cast(T);
TypeInfo EltInfo = getTypeInfo(VT->getElementType());
-Width = VT->isExtVectorBoolType() ? VT->getNumElements()
-
@@ -2016,8 +2016,9 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const
{
case Type::Vector: {
const auto *VT = cast(T);
TypeInfo EltInfo = getTypeInfo(VT->getElementType());
-Width = VT->isExtVectorBoolType() ? VT->getNumElements()
-
@@ -1984,6 +1984,15 @@ llvm::Constant
*ConstantEmitter::emitForMemory(CodeGenModule &CGM,
return Res;
}
+ // In HLSL bool vectors are stored in memory as a vector of i32
+ if (destType->isExtVectorBoolType() && CGM.getContext().getLangOpts().HLSL) {
+llvm::Type *b
@@ -14857,6 +14857,7 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E)
{
case CK_FixedPointCast:
case CK_IntegralToFixedPoint:
case CK_MatrixCast:
+// TODO does CK_HLSLAggregateCast belong here?
spall wrote:
It can, and I do need to remove
@@ -14857,6 +14857,7 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E)
{
case CK_FixedPointCast:
case CK_IntegralToFixedPoint:
case CK_MatrixCast:
+// TODO does CK_HLSLAggregateCast belong here?
spall wrote:
You can truncate (for example) a
@@ -6358,3 +6359,81 @@ RValue CodeGenFunction::EmitPseudoObjectRValue(const
PseudoObjectExpr *E,
LValue CodeGenFunction::EmitPseudoObjectLValue(const PseudoObjectExpr *E) {
return emitPseudoObjectExpr(*this, E, true, AggValueSlot::ignored()).LV;
}
+
+void CodeGenFunction::Fl
@@ -2016,8 +2016,9 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const
{
case Type::Vector: {
const auto *VT = cast(T);
TypeInfo EltInfo = getTypeInfo(VT->getElementType());
-Width = VT->isExtVectorBoolType() ? VT->getNumElements()
-
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/126258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/126561
Desugar type when converting from a ConstantArrayType to an ArrayParameterType
in getArrayParameterType
Closes #125743
>From 199395c935fc1da70db91bba94a1ea86afb83bf9 Mon Sep 17 00:00:00 2001
From: Sarah Spall
D
@@ -6358,3 +6359,81 @@ RValue CodeGenFunction::EmitPseudoObjectRValue(const
PseudoObjectExpr *E,
LValue CodeGenFunction::EmitPseudoObjectLValue(const PseudoObjectExpr *E) {
return emitPseudoObjectExpr(*this, E, true, AggValueSlot::ignored()).LV;
}
+
+void CodeGenFunction::Fl
spall wrote:
> Hi,
>
> We usually ask to include the reason for the revert in the commit message.
I apologize, there was a buildbot failure which seemed to be caused by the
reverted commit.
https://github.com/llvm/llvm-project/pull/126149
___
cfe-c
https://github.com/spall closed 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/spall created
https://github.com/llvm/llvm-project/pull/126149
Reverts llvm/llvm-project#118842
>From 6fd9dd96b0cd68d9bb04e791f90ec8ef5211563a Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 6 Feb 2025 15:17:49 -0800
Subject: [PATCH] Revert "[HLSL] Implement HLSL Flat
spall wrote:
> One small request: can you add a test that verifies we produce an error if
> you try to cast to or from a structure containing a bitfield?
I think I already did this
clang/test/SemaHLSL/Language/ElementwiseCast-errors.hlsl
https://github.com/llvm/llvm-project/pull/118842
__
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/126149
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall 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/spall edited https://github.com/llvm/llvm-project/pull/126258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/126258
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/126561
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/118992
>From e994824f3630ee8b224afceb6c14d980c9013112 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 6 Dec 2024 05:14:17 +
Subject: [PATCH 01/11] splat cast wip
---
clang/include/clang/AST/OperationKinds.def
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/118992
>From e994824f3630ee8b224afceb6c14d980c9013112 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 6 Dec 2024 05:14:17 +
Subject: [PATCH 01/13] splat cast wip
---
clang/include/clang/AST/OperationKinds.def
https://github.com/spall ready_for_review
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
@@ -2064,6 +2064,9 @@ llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value
*Value, QualType Ty) {
if (Ty->isExtVectorBoolType()) {
spall wrote:
My intention was to replace calls to 'isExtVectorBoolType' and
'isPackedVectorBoolType' anywhere we want an hl
https://github.com/spall 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
https://github.com/spall ready_for_review
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
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/10] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 1/8] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19 ++
@@ -0,0 +1,52 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes -o - %s |
FileCheck %s
+
+// CHECK: %struct.S = type { <2 x i32>, float }
+// CHECK: [[ConstS:@.*]] = private unnamed_addr constant %struct.S { <2
@@ -110,6 +131,24 @@ float2 HowManyFloats(float V) {
return V.rr.rr;
}
+// CHECK-LABEL: HowManyBools
+// CHECK: [[VAddr:%.*]] = alloca i32, align 4
+// CHECK-NEXT: [[Vec2Ptr:%.*]] = alloca <2 x i32>, align 1
spall wrote:
I probably need to update this test
@@ -3166,109 +3171,228 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh32(Register ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
-bool SPIRVInstructionSelector::selectFirstBitHigh64(Register ResVReg,
-const SPIRVTyp
https://github.com/spall approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/117245
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3166,109 +3171,228 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh32(Register ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
-bool SPIRVInstructionSelector::selectFirstBitHigh64(Register ResVReg,
-const SPIRVTyp
https://github.com/spall edited 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
@@ -3166,109 +3171,228 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh32(Register ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
-bool SPIRVInstructionSelector::selectFirstBitHigh64(Register ResVReg,
-const SPIRVTyp
https://github.com/spall closed https://github.com/llvm/llvm-project/pull/117245
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
spall wrote:
> This looks correct, but how much work is it to update all of these tests to
> have fast math enabled rather than explicitly disabling it? I worry that (1)
> folks looking at these tests in the future will think that disabling fast
> math is a meaningful part of the test and (2)
@@ -3166,109 +3171,228 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh32(Register ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
-bool SPIRVInstructionSelector::selectFirstBitHigh64(Register ResVReg,
-const SPIRVTyp
@@ -3166,109 +3171,228 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh32(Register ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
-bool SPIRVInstructionSelector::selectFirstBitHigh64(Register ResVReg,
-const SPIRVTyp
@@ -96,15 +96,20 @@ class SPIRVInstructionSelector : public InstructionSelector
{
bool selectFirstBitHigh(Register ResVReg, const SPIRVType *ResType,
MachineInstr &I, bool IsSigned) const;
- bool selectFirstBitHigh16(Register ResVReg, const SPIRVT
@@ -3166,109 +3171,228 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh32(Register ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
-bool SPIRVInstructionSelector::selectFirstBitHigh64(Register ResVReg,
-const SPIRVTyp
@@ -3166,109 +3171,228 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh32(Register ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
-bool SPIRVInstructionSelector::selectFirstBitHigh64(Register ResVReg,
-const SPIRVTyp
https://github.com/spall edited 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/spall edited 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
spall wrote:
I'd also update your description to mention fixing the vector > size 2 bug in
FirstBitHigh as well, by making this code general purpose for both firstbitlow
and firstbithigh.
https://github.com/llvm/llvm-project/pull/116858
___
cfe-commi
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/119820
Make fast math the default for HLSL
Closes #108597
>From d167cd92875f7aec8ed3ab15c3321ee9000e8481 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 12 Dec 2024 20:35:47 +
Subject: [PATCH 1/2] make fast m
https://github.com/spall ready_for_review
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/spall edited 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/spall edited 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
spall wrote:
Waiting on #120630
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
@@ -3158,6 +3172,166 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh(Register ResVReg,
}
}
+bool SPIRVInstructionSelector::selectFirstBitLow16(Register ResVReg,
+ const SPIRVType *ResType,
+
@@ -3158,6 +3172,166 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh(Register ResVReg,
}
}
+bool SPIRVInstructionSelector::selectFirstBitLow16(Register ResVReg,
+ const SPIRVType *ResType,
+
@@ -3158,6 +3172,166 @@ bool
SPIRVInstructionSelector::selectFirstBitHigh(Register ResVReg,
}
}
+bool SPIRVInstructionSelector::selectFirstBitLow16(Register ResVReg,
+ const SPIRVType *ResType,
+
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/111047
>From 119def060924f13bd1fe07f6d73ce27a1b52ea12 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Tue, 17 Sep 2024 20:25:46 +
Subject: [PATCH 1/8] theoretically fix issue
---
clang/lib/Sema/SemaType.cpp | 4 ++
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/118842
>From 2e932a57ccb992b856b58bec4c30c6b64f24f711 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 28 Nov 2024 16:23:57 +
Subject: [PATCH 1/5] Flat casts WIP
---
clang/include/clang/AST/OperationKinds.def
spall wrote:
Work for this PR begins at 'splat cast wip' commit.
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/spall created
https://github.com/llvm/llvm-project/pull/118992
Implement HLSL Flat casting that handles splatting for arrays and structs, and
vectors if splatting from a vec1.
Closes #100609 and Closes #100619
Depends on #118842
>From 2e932a57ccb992b856b58bec4c30c6b64f24f7
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/118992
>From 2e932a57ccb992b856b58bec4c30c6b64f24f711 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 28 Nov 2024 16:23:57 +
Subject: [PATCH 1/8] Flat casts WIP
---
clang/include/clang/AST/OperationKinds.def
@@ -3178,98 +3178,74 @@ bool
SPIRVInstructionSelector::selectFirstBitSet64Overflow(
Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
Register SrcReg, unsigned BitSetOpcode, bool SwapPrimarySide) const {
+ // SPIR-V only allow vecs of size 2,3,4. Calling w
@@ -3178,98 +3178,74 @@ bool
SPIRVInstructionSelector::selectFirstBitSet64Overflow(
Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
Register SrcReg, unsigned BitSetOpcode, bool SwapPrimarySide) const {
+ // SPIR-V only allow vecs of size 2,3,4. Calling w
@@ -3178,98 +3178,74 @@ bool
SPIRVInstructionSelector::selectFirstBitSet64Overflow(
Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
Register SrcReg, unsigned BitSetOpcode, bool SwapPrimarySide) const {
+ // SPIR-V only allow vecs of size 2,3,4. Calling w
@@ -3178,98 +3178,74 @@ bool
SPIRVInstructionSelector::selectFirstBitSet64Overflow(
Register ResVReg, const SPIRVType *ResType, MachineInstr &I,
Register SrcReg, unsigned BitSetOpcode, bool SwapPrimarySide) const {
+ // SPIR-V only allow vecs of size 2,3,4. Calling w
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/123977
Make the memory representation of boolean vectors in HLSL, vectors of i32.
Allow boolean swizzling for boolean vectors in HLSL.
Add tests for boolean vectors and boolean vector swizzling.
Closes #91639
>From 50f8
@@ -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?
spall wrote:
@llv
https://github.com/spall converted_to_draft
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
https://github.com/spall closed 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/spall closed 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
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/118992
>From e994824f3630ee8b224afceb6c14d980c9013112 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 6 Dec 2024 05:14:17 +
Subject: [PATCH 01/19] splat cast wip
---
clang/include/clang/AST/OperationKinds.def
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/12] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
@@ -110,6 +131,24 @@ float2 HowManyFloats(float V) {
return V.rr.rr;
}
+// CHECK-LABEL: HowManyBools
+// CHECK: [[VAddr:%.*]] = alloca i32, align 4
+// CHECK-NEXT: [[Vec2Ptr:%.*]] = alloca <2 x i32>, align 8
+// CHECK-NEXT: [[Tmp:%.*]] = zext i1 {{.*}} to i32
+// CHECK-NEXT:
https://github.com/spall closed 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/spall edited 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/spall edited 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
@@ -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)
spall wrote:
Yes, I g
@@ -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)
spall wrote:
Does thi
@@ -0,0 +1,87 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm -disable-llvm-passes -o - %s
| FileCheck %s
+
+// array splat
+// CHECK-LABEL: define void {{.*}}call4
+// CHECK: [[B:%.*]] = alloca [2 x i32], align 4
+// CHE
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/118992
>From e994824f3630ee8b224afceb6c14d980c9013112 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 6 Dec 2024 05:14:17 +
Subject: [PATCH 1/9] splat cast wip
---
clang/include/clang/AST/OperationKinds.def |
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/11] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
@@ -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
@@ -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/spall updated
https://github.com/llvm/llvm-project/pull/118992
>From e994824f3630ee8b224afceb6c14d980c9013112 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 6 Dec 2024 05:14:17 +
Subject: [PATCH 01/18] splat cast wip
---
clang/include/clang/AST/OperationKinds.def
@@ -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
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/13] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
@@ -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)
spall wrote:
This cast technically also splats vectors in
@@ -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
https://github.com/spall created
https://github.com/llvm/llvm-project/pull/127896
Enable Arrays to be returned in HLSL, and a test for this.
Closes #126568
>From 362b64d31e5f70e4a26ea04c99a58fd5f5ca50ca Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 14 Feb 2025 12:59:56 -0800
Subject:
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/127896
>From 362b64d31e5f70e4a26ea04c99a58fd5f5ca50ca Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 14 Feb 2025 12:59:56 -0800
Subject: [PATCH 1/4] Allow arrays to be returned by value in HLSL + test
---
clang/
https://github.com/spall closed 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/spall updated
https://github.com/llvm/llvm-project/pull/127896
>From 362b64d31e5f70e4a26ea04c99a58fd5f5ca50ca Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 14 Feb 2025 12:59:56 -0800
Subject: [PATCH 1/2] Allow arrays to be returned by value in HLSL + test
---
clang/
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/14] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/127896
>From 362b64d31e5f70e4a26ea04c99a58fd5f5ca50ca Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Fri, 14 Feb 2025 12:59:56 -0800
Subject: [PATCH 1/3] Allow arrays to be returned by value in HLSL + test
---
clang/
@@ -410,6 +410,12 @@ VectorType::VectorType(TypeClass tc, QualType vecType,
unsigned nElements,
VectorTypeBits.NumElements = nElements;
}
+bool Type::isPackedVectorBoolType(const ASTContext &ctx) const {
+ if (ctx.getLangOpts().HLSL)
spall wrote:
The code
https://github.com/spall updated
https://github.com/llvm/llvm-project/pull/123977
>From 50f8b16bf83d70cc37f2ac7e70c9195a4c4cda02 Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Thu, 16 Jan 2025 01:32:25 +
Subject: [PATCH 01/15] wip
---
clang/lib/CodeGen/CGExpr.cpp | 19
https://github.com/spall approved this pull request.
https://github.com/llvm/llvm-project/pull/127921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/125807
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall approved this pull request.
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/spall updated
https://github.com/llvm/llvm-project/pull/128952
>From 656d6e87466bfc85246f7abaedfe6549e566717b Mon Sep 17 00:00:00 2001
From: Sarah Spall
Date: Wed, 26 Feb 2025 14:37:06 -0800
Subject: [PATCH 1/2] error on out of bounds vector accesses
---
.../clang/Basic/Dia
https://github.com/spall ready_for_review
https://github.com/llvm/llvm-project/pull/128952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/128952
___
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
https://github.com/spall edited https://github.com/llvm/llvm-project/pull/128952
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
101 - 200 of 354 matches
Mail list logo