File tree 4 files changed +39
-5
lines changed
4 files changed +39
-5
lines changed Original file line number Diff line number Diff line change @@ -2976,6 +2976,10 @@ class CMMemberExpr : public Expr {
2976
2976
child_range children () {
2977
2977
return child_range (SubExprs, SubExprs + NumSubExprs);
2978
2978
}
2979
+
2980
+ const_child_range children () const {
2981
+ return const_child_range (SubExprs, SubExprs + NumSubExprs);
2982
+ }
2979
2983
};
2980
2984
2981
2985
// / \brief Represent CM select member functions.
Original file line number Diff line number Diff line change @@ -142,6 +142,8 @@ class CMSizeExpr : public CMMemberExpr {
142
142
C.IntTy, VK_RValue),
143
143
Kind (SK), RParenLoc(RPLoc) {}
144
144
145
+ CMSizeExprKind getCMSizeKind () const { return Kind; }
146
+
145
147
bool isNElems () const { return Kind == SK_n_elems; }
146
148
bool isNRows () const { return Kind == SK_n_rows; }
147
149
bool isNCols () const { return Kind == SK_n_cols; }
Original file line number Diff line number Diff line change @@ -1131,23 +1131,28 @@ void StmtProfiler::VisitMemberExpr(const MemberExpr *S) {
1131
1131
}
1132
1132
1133
1133
void StmtProfiler::VisitCMSelectExpr (const CMSelectExpr *S) {
1134
- llvm_unreachable (" not implemented yet" );
1134
+ VisitExpr (S);
1135
+ ID.AddInteger (S->getSelectKind ());
1136
+ ID.AddInteger (S->getNumConstArgs ());
1135
1137
}
1136
1138
1137
1139
void StmtProfiler::VisitCMBoolReductionExpr (const CMBoolReductionExpr *S) {
1138
- llvm_unreachable (" not implemented yet" );
1140
+ VisitExpr (S);
1141
+ ID.AddInteger (S->getBoolReductionKind ());
1139
1142
}
1140
1143
1141
1144
void StmtProfiler::VisitCMFormatExpr (const CMFormatExpr *S) {
1142
- llvm_unreachable (" not implemented yet" );
1145
+ VisitExpr (S);
1146
+ VisitType (S->getElementType ());
1143
1147
}
1144
1148
1145
1149
void StmtProfiler::VisitCMMergeExpr (const CMMergeExpr *S) {
1146
- llvm_unreachable ( " not implemented yet " );
1150
+ VisitExpr (S );
1147
1151
}
1148
1152
1149
1153
void StmtProfiler::VisitCMSizeExpr (const CMSizeExpr *S) {
1150
- llvm_unreachable (" not implemented yet" );
1154
+ VisitExpr (S);
1155
+ ID.AddInteger (S->getCMSizeKind ());
1151
1156
}
1152
1157
1153
1158
void StmtProfiler::VisitCompoundLiteralExpr (const CompoundLiteralExpr *S) {
Original file line number Diff line number Diff line change
1
+ /* ========================== begin_copyright_notice ============================
2
+
3
+ Copyright (C) 2022 Intel Corporation
4
+
5
+ SPDX-License-Identifier: MIT
6
+
7
+ ============================= end_copyright_notice ===========================*/
8
+
9
+ // Check that dependent CM expressions do not cause compiler crash.
10
+
11
+ // RUN: %cmc -march=SKL -S -emit-llvm -- %s
12
+
13
+ template <int N>
14
+ int vec_size (vector<int , N> x) {
15
+ vector<int , x.n_elems ()> y;
16
+ (void )y;
17
+ }
18
+
19
+ template <int N>
20
+ int mat_size (matrix<int , N, N> x) {
21
+ vector<int , x.n_rows () + x.n_cols ()> y;
22
+ (void )y;
23
+ }
You can’t perform that action at this time.
0 commit comments