[clang] Enable matrices in HLSL (PR #111415)

2024-12-03 Thread Florian Hahn via cfe-commits
@@ -2447,7 +2447,7 @@ QualType Sema::BuildExtVectorType(QualType T, Expr *ArraySize, QualType Sema::BuildMatrixType(QualType ElementTy, Expr *NumRows, Expr *NumCols, SourceLocation AttrLoc) { - assert(Context.getLangOpts().MatrixTypes && + as

[clang] Enable matrices in HLSL (PR #111415)

2024-12-03 Thread Florian Hahn via cfe-commits
@@ -459,8 +459,81 @@ void HLSLExternalSemaSource::defineHLSLVectorAlias() { HLSLNamespace->addDecl(Template); } +void HLSLExternalSemaSource::defineHLSLMatrixAlias() { + ASTContext &AST = SemaPtr->getASTContext(); fhahn wrote: Could you add a comment here

[clang] Enable matrices in HLSL (PR #111415)

2024-12-03 Thread Florian Hahn via cfe-commits
@@ -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 <

[clang] Enable matrices in HLSL (PR #111415)

2024-11-05 Thread Greg Roth via cfe-commits
@@ -852,34 +852,51 @@ void TypePrinter::printExtVectorAfter(const ExtVectorType *T, raw_ostream &OS) { void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T, raw_ostream &OS) { + if (Policy.UseHLSLTypes) +OS <

[clang] Enable matrices in HLSL (PR #111415)

2024-11-05 Thread Greg Roth via cfe-commits
@@ -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

[clang] Enable matrices in HLSL (PR #111415)

2024-11-04 Thread Chris B via cfe-commits
@@ -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

[clang] Enable matrices in HLSL (PR #111415)

2024-11-04 Thread Greg Roth via cfe-commits
@@ -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; - //

[clang] Enable matrices in HLSL (PR #111415)

2024-11-04 Thread Chris B via cfe-commits
@@ -852,34 +852,51 @@ void TypePrinter::printExtVectorAfter(const ExtVectorType *T, raw_ostream &OS) { void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T, raw_ostream &OS) { + if (Policy.UseHLSLTypes) +OS <

[clang] Enable matrices in HLSL (PR #111415)

2024-10-14 Thread Greg Roth via cfe-commits
@@ -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) --

[clang] Enable matrices in HLSL (PR #111415)

2024-10-11 Thread Greg Roth via cfe-commits
https://github.com/pow2clk edited https://github.com/llvm/llvm-project/pull/111415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable matrices in HLSL (PR #111415)

2024-10-11 Thread Greg Roth via cfe-commits
@@ -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; - //

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Chris B via cfe-commits
@@ -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; - //

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Greg Roth via cfe-commits
@@ -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; - //

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Greg Roth via cfe-commits
@@ -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 <

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Greg Roth via cfe-commits
@@ -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) --

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Greg Roth via cfe-commits
https://github.com/pow2clk edited https://github.com/llvm/llvm-project/pull/111415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Greg Roth via cfe-commits
https://github.com/pow2clk edited https://github.com/llvm/llvm-project/pull/111415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Greg Roth via cfe-commits
@@ -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; - //

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Chris B via cfe-commits
@@ -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) --

[clang] Enable matrices in HLSL (PR #111415)

2024-10-10 Thread Florian Hahn via cfe-commits
@@ -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; - //

[clang] Enable matrices in HLSL (PR #111415)

2024-10-09 Thread Farzon Lotfi via cfe-commits
@@ -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) --

[clang] Enable matrices in HLSL (PR #111415)

2024-10-07 Thread Chris B via cfe-commits
@@ -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 <

[clang] Enable matrices in HLSL (PR #111415)

2024-10-07 Thread Greg Roth via cfe-commits
@@ -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 <

[clang] Enable matrices in HLSL (PR #111415)

2024-10-07 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Greg Roth (pow2clk) Changes HLSL needs matrix support. This allows matrices when the target language is HLSL and defines a matrix template alias that allows the short forms of matrix types to be defined in typedefs in a default header. Ma