[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-19 Thread Chris B via cfe-commits
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static void BuildFlattenedTypeList(QualType BaseTy, + llvm::SmallVectorImpl &List) { + llvm::SmallVector WorkList

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-16 Thread Aaron Ballman via cfe-commits
@@ -6188,6 +6189,23 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, const TypeSourceI TSTToBeDeduced->getTemplateName().getAsTemplateDecl(), RhsT, Info) == TemplateDeductionResult::Success; } + case BTT_IsScalarizedLayoutCompa

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-16 Thread Aaron Ballman via cfe-commits
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static void BuildFlattenedTypeList(QualType BaseTy, + llvm::SmallVectorImpl &List) { + llvm::SmallVector WorkList

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-16 Thread Aaron Ballman via cfe-commits
@@ -6188,6 +6189,23 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, const TypeSourceI TSTToBeDeduced->getTemplateName().getAsTemplateDecl(), RhsT, Info) == TemplateDeductionResult::Success; } + case BTT_IsScalarizedLayoutCompa

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/102227 >From 5361c74f0130839870dae2b84abd9d9e75cf787b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 5 Aug 2024 13:22:47 -0500 Subject: [PATCH 1/3] [HLSL] Add __is_scalarized_layout_compatible HLSL tends

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff a1af1de4380f9c4fa3b5229e9f4a41af93955c38 f1204453733faec7df428f6d6aa708c0b02db22b --e

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
https://github.com/llvm-beanz updated https://github.com/llvm/llvm-project/pull/102227 >From 5361c74f0130839870dae2b84abd9d9e75cf787b Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Mon, 5 Aug 2024 13:22:47 -0500 Subject: [PATCH 1/2] [HLSL] Add __is_scalarized_layout_compatible HLSL tends

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Aaron Ballman via cfe-commits
@@ -658,6 +658,9 @@ KEYWORD(out , KEYHLSL) #define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) KEYWORD(Name, KEYHLSL) #include "clang/Basic/HLSLIntangibleTypes.def" +// HLSL Type traits. +TYPE_TRAIT_2(__is_scalarized_layout_compatible, IsScalarizedLayou

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static void BuildFlattenedTypeList(QualType BaseTy, + llvm::SmallVectorImpl &List) { + llvm::SmallVector WorkList

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static void BuildFlattenedTypeList(QualType BaseTy, + llvm::SmallVectorImpl &List) { + llvm::SmallVector WorkList

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-15 Thread Chris B via cfe-commits
llvm-beanz wrote: > Is this the expected behaviour: > > ```c++ > struct EmptyPadding : Empty { Empty e; int X; }; > struct Repeated : Empty, DerivedEmpty { int X; }; // expected-warning > {{inaccessible due to ambiguity}} > _Static_assert(sizeof(EmptyPadding) == 8, ""); > _Static_assert(sizeof(

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-13 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,132 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -finclude-default-header -verify %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -finclude-default-header -fnative-half-type -verify %s +// expected-no-diagnostics + +// Case 1: How many w

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-13 Thread Damyan Pepper via cfe-commits
@@ -0,0 +1,132 @@ +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -finclude-default-header -verify %s +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.6-library -finclude-default-header -fnative-half-type -verify %s +// expected-no-diagnostics + +// Case 1: How many w

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-13 Thread Damyan Pepper via cfe-commits
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static void BuildFlattenedTypeList(QualType BaseTy, + llvm::SmallVectorImpl &List) { + llvm::SmallVector WorkList

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-13 Thread Damyan Pepper via cfe-commits
@@ -1142,3 +1142,85 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { } return false; } + +static void BuildFlattenedTypeList(QualType BaseTy, + llvm::SmallVectorImpl &List) { + llvm::SmallVector WorkList

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-13 Thread Damyan Pepper via cfe-commits
https://github.com/damyanp approved this pull request. 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

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-13 Thread Damyan Pepper via cfe-commits
damyanp wrote: > 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. Some typos: * occuring --> occurring * complier --> compiler * sclarized

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-08 Thread Mital Ashok via cfe-commits
MitalAshok wrote: Is this the expected behaviour: ```c++ struct EmptyPadding : Empty { Empty e; int X; }; struct Repeated : Empty, DerivedEmpty { int X; }; // expected-warning {{inaccessible due to ambiguity}} _Static_assert(sizeof(EmptyPadding) == 8, ""); _Static_assert(sizeof(Repeated) == 8,

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-06 Thread Helena Kotas via cfe-commits
https://github.com/hekota approved this pull request. LGTM! 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

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Chris B (llvm-beanz) Changes 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 chan

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-06 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Chris B (llvm-beanz) Changes 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 cha

[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)

2024-08-06 Thread Chris B via cfe-commits
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