@@ -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
@@ -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
@@ -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 <
@@ -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 <
@@ -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
@@ -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
@@ -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;
- //
@@ -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 <
@@ -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)
--
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
@@ -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;
- //
@@ -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;
- //
@@ -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;
- //
@@ -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 <
@@ -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)
--
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
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
@@ -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;
- //
@@ -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)
--
@@ -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;
- //
@@ -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)
--
@@ -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 <
@@ -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 <
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
24 matches
Mail list logo