[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-15 Thread Chris B via cfe-commits
llvm-beanz wrote: I pushed a speculative fix in 0065161c720c37e8ab545979aed6a03d944a3176. I think the assert I added was too aggressive. https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-15 Thread via cfe-commits
Prabhuk wrote: Seeing the crash in Linux CI toolchain builders. ``` Command Output (stderr): -- RUN: at line 2: /b/s/w/ir/x/w/llvm_build/bin/clang -cc1 -internal-isystem /b/s/w/ir/x/w/llvm_build/lib/clang/19/include -nostdsysteminc -ffp-exception-behavior=maytrap

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-15 Thread via cfe-commits
dyung wrote: > Is this causing these crashes? http://45.33.8.238/linux/130945/step_7.txt I can confirm that this commit is causing these crashes. @llvm-beanz can you take a look or revert? https://github.com/llvm/llvm-project/pull/71098 ___

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-15 Thread Nico Weber via cfe-commits
nico wrote: Is this causing these crashes? http://45.33.8.238/linux/130945/step_7.txt https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Vector standard conversions (PR #71098)

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

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Chris B via cfe-commits
@@ -6432,7 +6432,7 @@ void InitializationSequence::InitializeFrom(Sema , // For HLSL ext vector types we allow list initialization behavior for C++ // constructor syntax. This is accomplished by converting initialization // arguments an InitListExpr late. - if

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Justin Bogner via cfe-commits
@@ -113,30 +115,12 @@ float2 HowManyFloats(float V) { // up nicely too. // CHECK-LABEL: AllRighty -// CHECK: [[XTmp:%.*]] = alloca <1 x double>, align 8 -// CHECK: [[YTmp:%.*]] = alloca <1 x double>, align 8 -// CHECK: [[ZTmp:%.*]] = alloca <1 x double>, align 8 - -// CHECK:

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Justin Bogner via cfe-commits
@@ -4772,6 +4788,76 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, llvm_unreachable("Improper second standard conversion"); } + if (SCS.Element != ICK_Identity) { +// If SCS.Element is not ICK_Identity the To and From types must be HLSL +//

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Justin Bogner via cfe-commits
@@ -6432,7 +6432,7 @@ void InitializationSequence::InitializeFrom(Sema , // For HLSL ext vector types we allow list initialization behavior for C++ // constructor syntax. This is accomplished by converting initialization // arguments an InitListExpr late. - if

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Justin Bogner via cfe-commits
@@ -4772,6 +4788,76 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, llvm_unreachable("Improper second standard conversion"); } + if (SCS.Element != ICK_Identity) { +// If SCS.Element is not ICK_Identity the To and From types must be HLSL +//

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Justin Bogner via cfe-commits
@@ -123,84 +123,83 @@ CompareDerivedToBaseConversions(Sema , SourceLocation Loc, /// GetConversionRank - Retrieve the implicit conversion rank /// corresponding to the given implicit conversion kind. ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind)

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Justin Bogner via cfe-commits
https://github.com/bogner approved this pull request. Looks good barring a few minor comments https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-14 Thread Justin Bogner via cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-13 Thread John McCall via cfe-commits
https://github.com/rjmccall approved this pull request. Thanks, LGTM https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-12 Thread John McCall via cfe-commits
@@ -361,6 +361,9 @@ CAST_OPERATION(AddressSpaceConversion) // Convert an integer initializer to an OpenCL sampler. CAST_OPERATION(IntToOCLSampler) +// Truncate a vector type (HLSL only). +CAST_OPERATION(HLSLVectorTruncation) rjmccall wrote: Okay. I think

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-07 Thread Chris B via cfe-commits
@@ -1843,13 +1843,86 @@ bool Sema::IsFunctionConversion(QualType FromType, QualType ToType, return true; } +/// Determine whether the conversion from FromType to ToType is a valid +/// floating point conversion. +/// +static bool IsFloatingPointConversion(Sema , QualType

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-07 Thread Chris B via cfe-commits
@@ -361,6 +361,9 @@ CAST_OPERATION(AddressSpaceConversion) // Convert an integer initializer to an OpenCL sampler. CAST_OPERATION(IntToOCLSampler) +// Truncate a vector type (HLSL only). +CAST_OPERATION(HLSLVectorTruncation) llvm-beanz wrote: Yea... HLSL has

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-07 Thread Chris B via cfe-commits
@@ -2414,9 +2420,41 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { return EmitScalarConversion(Visit(E), E->getType(), DestTy, CE->getExprLoc(), Opts); } - case CK_IntegralToFloating: - case CK_FloatingToIntegral: - case

[clang] [HLSL] Vector standard conversions (PR #71098)

2024-02-07 Thread Chris B via cfe-commits
@@ -2466,6 +2504,15 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { case CK_IntToOCLSampler: return CGF.CGM.createOpenCLIntToSamplerConversion(E, CGF); + case CK_HLSLVectorTruncation: { +assert(DestTy->isVectorType() && "Expected dest type to be vector

[clang-tools-extra] [llvm] [clang] [HLSL] Vector standard conversions (PR #71098)

2024-01-08 Thread Chris B via cfe-commits
@@ -4763,6 +4763,20 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, CK_ZeroToOCLOpaqueType, From->getValueKind()).get(); break; + case ICK_HLSL_Vector_Truncation: { +// Note: HLSL vectors are

[clang-tools-extra] [llvm] [clang] [HLSL] Vector standard conversions (PR #71098)

2023-12-19 Thread John McCall via cfe-commits
@@ -2466,6 +2504,14 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { case CK_IntToOCLSampler: return CGF.CGM.createOpenCLIntToSamplerConversion(E, CGF); + case CK_HLSLVectorTruncation: { +assert(DestTy->isVectorType() && "Expected dest type to be vector

[clang-tools-extra] [llvm] [clang] [HLSL] Vector standard conversions (PR #71098)

2023-12-19 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/71098 >From 91e8d9d9f63fe2ac481bb01549e3d69ac59d68f8 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 1 Nov 2023 12:18:43 -0500 Subject: [PATCH 1/7] [HLSL] Vector vector standard conversions HLSL supports

[llvm] [clang-tools-extra] [clang] [HLSL] Vector standard conversions (PR #71098)

2023-12-19 Thread Chris B via cfe-commits
llvm-beanz wrote: ping @efriedma-quic & @rjmccall https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-12-13 Thread John McCall via cfe-commits
@@ -1422,6 +1424,9 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType, return Builder.CreateVectorSplat(NumElements, Src, "splat"); } + if (SrcType->isExtVectorType() && DstType->isExtVectorType()) +return

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-12-12 Thread Eli Friedman via cfe-commits
@@ -1422,6 +1424,9 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType, return Builder.CreateVectorSplat(NumElements, Src, "splat"); } + if (SrcType->isExtVectorType() && DstType->isExtVectorType()) +return

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-12-11 Thread Chris B via cfe-commits
llvm-beanz wrote: @rjmccall & @efriedma-quic, do the CodeGen changes here look okay to you? https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-30 Thread Aaron Ballman via cfe-commits
@@ -123,82 +123,59 @@ CompareDerivedToBaseConversions(Sema , SourceLocation Loc, /// GetConversionRank - Retrieve the implicit conversion rank /// corresponding to the given implicit conversion kind. ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind)

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Chris B via cfe-commits
@@ -123,82 +123,59 @@ CompareDerivedToBaseConversions(Sema , SourceLocation Loc, /// GetConversionRank - Retrieve the implicit conversion rank /// corresponding to the given implicit conversion kind. ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind)

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/71098 >From 91e8d9d9f63fe2ac481bb01549e3d69ac59d68f8 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 1 Nov 2023 12:18:43 -0500 Subject: [PATCH 1/6] [HLSL] Vector vector standard conversions HLSL supports

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/71098 >From 91e8d9d9f63fe2ac481bb01549e3d69ac59d68f8 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 1 Nov 2023 12:18:43 -0500 Subject: [PATCH 1/5] [HLSL] Vector vector standard conversions HLSL supports

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Aaron Ballman via cfe-commits
@@ -123,82 +123,59 @@ CompareDerivedToBaseConversions(Sema , SourceLocation Loc, /// GetConversionRank - Retrieve the implicit conversion rank /// corresponding to the given implicit conversion kind. ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind)

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Chris B via cfe-commits
@@ -123,82 +123,59 @@ CompareDerivedToBaseConversions(Sema , SourceLocation Loc, /// GetConversionRank - Retrieve the implicit conversion rank /// corresponding to the given implicit conversion kind. ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind)

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Adding some additional reviewers to look over codegen changes and also for another set of eyes on the conversion changes in Sema (the changes look correct to me, but conversion logic is dense enough that getting more eyes on it is a good idea).

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Aaron Ballman via cfe-commits
@@ -361,6 +361,9 @@ CAST_OPERATION(AddressSpaceConversion) // Convert an integer initializer to an OpenCL sampler. CAST_OPERATION(IntToOCLSampler) +// Truncate a vector type (HLSL only). +CAST_OPERATION(VectorTruncation) AaronBallman wrote: Should we name

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Aaron Ballman via cfe-commits
@@ -123,82 +123,59 @@ CompareDerivedToBaseConversions(Sema , SourceLocation Loc, /// GetConversionRank - Retrieve the implicit conversion rank /// corresponding to the given implicit conversion kind. ImplicitConversionRank clang::GetConversionRank(ImplicitConversionKind Kind)

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Aaron Ballman via cfe-commits
@@ -4966,6 +4967,7 @@ LValue CodeGenFunction::EmitCastLValue(const CastExpr *E) { return MakeAddrLValue(V, E->getType(), LV.getBaseInfo(), CGM.getTBAAInfoForSubobject(LV, E->getType())); } + AaronBallman wrote: Spurious

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-29 Thread Aaron Ballman via cfe-commits
@@ -4739,6 +4753,76 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, llvm_unreachable("Improper second standard conversion"); } + if (SCS.Element != ICK_Identity) { +// if SCS.Element is not ICK_Identity the To and From types must be HLSL

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-27 Thread Chris B via cfe-commits
llvm-beanz wrote: @AaronBallman, gentle ping  https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Vector standard conversions (PR #71098)

2023-11-09 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/71098 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits