@@ -37,14 +37,14 @@ class AArch64SelectionDAGTest : public testing::Test {
37
37
// initialize a target. A skeleton Target for unittests would allow us to
38
38
// always run these tests.
39
39
if (!T)
40
- return ;
40
+ GTEST_SKIP () ;
41
41
42
42
TargetOptions Options;
43
43
TM = std::unique_ptr<LLVMTargetMachine>(static_cast <LLVMTargetMachine *>(
44
44
T->createTargetMachine (" AArch64" , " " , " +sve" , Options, None, None,
45
45
CodeGenOpt::Aggressive)));
46
46
if (!TM)
47
- return ;
47
+ GTEST_SKIP () ;
48
48
49
49
SMDiagnostic SMError;
50
50
M = parseAssemblyString (Assembly, SMError, Context);
@@ -85,8 +85,6 @@ class AArch64SelectionDAGTest : public testing::Test {
85
85
};
86
86
87
87
TEST_F (AArch64SelectionDAGTest, computeKnownBits_ZERO_EXTEND_VECTOR_INREG) {
88
- if (!TM)
89
- return ;
90
88
SDLoc Loc;
91
89
auto Int8VT = EVT::getIntegerVT (Context, 8 );
92
90
auto Int16VT = EVT::getIntegerVT (Context, 16 );
@@ -100,8 +98,6 @@ TEST_F(AArch64SelectionDAGTest, computeKnownBits_ZERO_EXTEND_VECTOR_INREG) {
100
98
}
101
99
102
100
TEST_F (AArch64SelectionDAGTest, computeKnownBitsSVE_ZERO_EXTEND_VECTOR_INREG) {
103
- if (!TM)
104
- return ;
105
101
SDLoc Loc;
106
102
auto Int8VT = EVT::getIntegerVT (Context, 8 );
107
103
auto Int16VT = EVT::getIntegerVT (Context, 16 );
@@ -119,8 +115,6 @@ TEST_F(AArch64SelectionDAGTest, computeKnownBitsSVE_ZERO_EXTEND_VECTOR_INREG) {
119
115
}
120
116
121
117
TEST_F (AArch64SelectionDAGTest, computeKnownBits_EXTRACT_SUBVECTOR) {
122
- if (!TM)
123
- return ;
124
118
SDLoc Loc;
125
119
auto IntVT = EVT::getIntegerVT (Context, 8 );
126
120
auto VecVT = EVT::getVectorVT (Context, IntVT, 3 );
@@ -134,8 +128,6 @@ TEST_F(AArch64SelectionDAGTest, computeKnownBits_EXTRACT_SUBVECTOR) {
134
128
}
135
129
136
130
TEST_F (AArch64SelectionDAGTest, ComputeNumSignBits_SIGN_EXTEND_VECTOR_INREG) {
137
- if (!TM)
138
- return ;
139
131
SDLoc Loc;
140
132
auto Int8VT = EVT::getIntegerVT (Context, 8 );
141
133
auto Int16VT = EVT::getIntegerVT (Context, 16 );
@@ -148,8 +140,6 @@ TEST_F(AArch64SelectionDAGTest, ComputeNumSignBits_SIGN_EXTEND_VECTOR_INREG) {
148
140
}
149
141
150
142
TEST_F (AArch64SelectionDAGTest, ComputeNumSignBitsSVE_SIGN_EXTEND_VECTOR_INREG) {
151
- if (!TM)
152
- return ;
153
143
SDLoc Loc;
154
144
auto Int8VT = EVT::getIntegerVT (Context, 8 );
155
145
auto Int16VT = EVT::getIntegerVT (Context, 16 );
@@ -162,8 +152,6 @@ TEST_F(AArch64SelectionDAGTest, ComputeNumSignBitsSVE_SIGN_EXTEND_VECTOR_INREG)
162
152
}
163
153
164
154
TEST_F (AArch64SelectionDAGTest, ComputeNumSignBits_EXTRACT_SUBVECTOR) {
165
- if (!TM)
166
- return ;
167
155
SDLoc Loc;
168
156
auto IntVT = EVT::getIntegerVT (Context, 8 );
169
157
auto VecVT = EVT::getVectorVT (Context, IntVT, 3 );
@@ -176,9 +164,6 @@ TEST_F(AArch64SelectionDAGTest, ComputeNumSignBits_EXTRACT_SUBVECTOR) {
176
164
}
177
165
178
166
TEST_F (AArch64SelectionDAGTest, SimplifyDemandedVectorElts_EXTRACT_SUBVECTOR) {
179
- if (!TM)
180
- return ;
181
-
182
167
TargetLowering TL (*TM);
183
168
184
169
SDLoc Loc;
@@ -198,9 +183,6 @@ TEST_F(AArch64SelectionDAGTest, SimplifyDemandedVectorElts_EXTRACT_SUBVECTOR) {
198
183
}
199
184
200
185
TEST_F (AArch64SelectionDAGTest, SimplifyDemandedBitsNEON) {
201
- if (!TM)
202
- return ;
203
-
204
186
TargetLowering TL (*TM);
205
187
206
188
SDLoc Loc;
@@ -227,9 +209,6 @@ TEST_F(AArch64SelectionDAGTest, SimplifyDemandedBitsNEON) {
227
209
}
228
210
229
211
TEST_F (AArch64SelectionDAGTest, SimplifyDemandedBitsSVE) {
230
- if (!TM)
231
- return ;
232
-
233
212
TargetLowering TL (*TM);
234
213
235
214
SDLoc Loc;
@@ -254,8 +233,6 @@ TEST_F(AArch64SelectionDAGTest, SimplifyDemandedBitsSVE) {
254
233
255
234
// Piggy-backing on the AArch64 tests to verify SelectionDAG::computeKnownBits.
256
235
TEST_F (AArch64SelectionDAGTest, ComputeKnownBits_ADD) {
257
- if (!TM)
258
- return ;
259
236
SDLoc Loc;
260
237
auto IntVT = EVT::getIntegerVT (Context, 8 );
261
238
auto UnknownOp = DAG->getRegister (0 , IntVT);
@@ -275,8 +252,6 @@ TEST_F(AArch64SelectionDAGTest, ComputeKnownBits_ADD) {
275
252
276
253
// Piggy-backing on the AArch64 tests to verify SelectionDAG::computeKnownBits.
277
254
TEST_F (AArch64SelectionDAGTest, ComputeKnownBits_SUB) {
278
- if (!TM)
279
- return ;
280
255
SDLoc Loc;
281
256
auto IntVT = EVT::getIntegerVT (Context, 8 );
282
257
auto N0 = DAG->getConstant (0x55 , Loc, IntVT);
@@ -295,9 +270,6 @@ TEST_F(AArch64SelectionDAGTest, ComputeKnownBits_SUB) {
295
270
}
296
271
297
272
TEST_F (AArch64SelectionDAGTest, isSplatValue_Fixed_BUILD_VECTOR) {
298
- if (!TM)
299
- return ;
300
-
301
273
TargetLowering TL (*TM);
302
274
303
275
SDLoc Loc;
@@ -318,9 +290,6 @@ TEST_F(AArch64SelectionDAGTest, isSplatValue_Fixed_BUILD_VECTOR) {
318
290
}
319
291
320
292
TEST_F (AArch64SelectionDAGTest, isSplatValue_Fixed_ADD_of_BUILD_VECTOR) {
321
- if (!TM)
322
- return ;
323
-
324
293
TargetLowering TL (*TM);
325
294
326
295
SDLoc Loc;
@@ -345,9 +314,6 @@ TEST_F(AArch64SelectionDAGTest, isSplatValue_Fixed_ADD_of_BUILD_VECTOR) {
345
314
}
346
315
347
316
TEST_F (AArch64SelectionDAGTest, isSplatValue_Scalable_SPLAT_VECTOR) {
348
- if (!TM)
349
- return ;
350
-
351
317
TargetLowering TL (*TM);
352
318
353
319
SDLoc Loc;
@@ -368,9 +334,6 @@ TEST_F(AArch64SelectionDAGTest, isSplatValue_Scalable_SPLAT_VECTOR) {
368
334
}
369
335
370
336
TEST_F (AArch64SelectionDAGTest, isSplatValue_Scalable_ADD_of_SPLAT_VECTOR) {
371
- if (!TM)
372
- return ;
373
-
374
337
TargetLowering TL (*TM);
375
338
376
339
SDLoc Loc;
@@ -395,9 +358,6 @@ TEST_F(AArch64SelectionDAGTest, isSplatValue_Scalable_ADD_of_SPLAT_VECTOR) {
395
358
}
396
359
397
360
TEST_F (AArch64SelectionDAGTest, getSplatSourceVector_Fixed_BUILD_VECTOR) {
398
- if (!TM)
399
- return ;
400
-
401
361
TargetLowering TL (*TM);
402
362
403
363
SDLoc Loc;
@@ -413,9 +373,6 @@ TEST_F(AArch64SelectionDAGTest, getSplatSourceVector_Fixed_BUILD_VECTOR) {
413
373
}
414
374
415
375
TEST_F (AArch64SelectionDAGTest, getSplatSourceVector_Fixed_ADD_of_BUILD_VECTOR) {
416
- if (!TM)
417
- return ;
418
-
419
376
TargetLowering TL (*TM);
420
377
421
378
SDLoc Loc;
@@ -434,9 +391,6 @@ TEST_F(AArch64SelectionDAGTest, getSplatSourceVector_Fixed_ADD_of_BUILD_VECTOR)
434
391
}
435
392
436
393
TEST_F (AArch64SelectionDAGTest, getSplatSourceVector_Scalable_SPLAT_VECTOR) {
437
- if (!TM)
438
- return ;
439
-
440
394
TargetLowering TL (*TM);
441
395
442
396
SDLoc Loc;
@@ -452,9 +406,6 @@ TEST_F(AArch64SelectionDAGTest, getSplatSourceVector_Scalable_SPLAT_VECTOR) {
452
406
}
453
407
454
408
TEST_F (AArch64SelectionDAGTest, getSplatSourceVector_Scalable_ADD_of_SPLAT_VECTOR) {
455
- if (!TM)
456
- return ;
457
-
458
409
TargetLowering TL (*TM);
459
410
460
411
SDLoc Loc;
@@ -473,9 +424,6 @@ TEST_F(AArch64SelectionDAGTest, getSplatSourceVector_Scalable_ADD_of_SPLAT_VECTO
473
424
}
474
425
475
426
TEST_F (AArch64SelectionDAGTest, getRepeatedSequence_Patterns) {
476
- if (!TM)
477
- return ;
478
-
479
427
TargetLowering TL (*TM);
480
428
481
429
SDLoc Loc;
@@ -594,45 +542,30 @@ TEST_F(AArch64SelectionDAGTest, getRepeatedSequence_Patterns) {
594
542
}
595
543
596
544
TEST_F (AArch64SelectionDAGTest, getTypeConversion_SplitScalableMVT) {
597
- if (!TM)
598
- return ;
599
-
600
545
MVT VT = MVT::nxv4i64;
601
546
EXPECT_EQ (getTypeAction (VT), TargetLoweringBase::TypeSplitVector);
602
547
ASSERT_TRUE (getTypeToTransformTo (VT).isScalableVector ());
603
548
}
604
549
605
550
TEST_F (AArch64SelectionDAGTest, getTypeConversion_PromoteScalableMVT) {
606
- if (!TM)
607
- return ;
608
-
609
551
MVT VT = MVT::nxv2i32;
610
552
EXPECT_EQ (getTypeAction (VT), TargetLoweringBase::TypePromoteInteger);
611
553
ASSERT_TRUE (getTypeToTransformTo (VT).isScalableVector ());
612
554
}
613
555
614
556
TEST_F (AArch64SelectionDAGTest, getTypeConversion_NoScalarizeMVT_nxv1f32) {
615
- if (!TM)
616
- return ;
617
-
618
557
MVT VT = MVT::nxv1f32;
619
558
EXPECT_NE (getTypeAction (VT), TargetLoweringBase::TypeScalarizeVector);
620
559
ASSERT_TRUE (getTypeToTransformTo (VT).isScalableVector ());
621
560
}
622
561
623
562
TEST_F (AArch64SelectionDAGTest, getTypeConversion_SplitScalableEVT) {
624
- if (!TM)
625
- return ;
626
-
627
563
EVT VT = EVT::getVectorVT (Context, MVT::i64, 256 , true );
628
564
EXPECT_EQ (getTypeAction (VT), TargetLoweringBase::TypeSplitVector);
629
565
EXPECT_EQ (getTypeToTransformTo (VT), VT.getHalfNumVectorElementsVT (Context));
630
566
}
631
567
632
568
TEST_F (AArch64SelectionDAGTest, getTypeConversion_WidenScalableEVT) {
633
- if (!TM)
634
- return ;
635
-
636
569
EVT FromVT = EVT::getVectorVT (Context, MVT::i64, 6 , true );
637
570
EVT ToVT = EVT::getVectorVT (Context, MVT::i64, 8 , true );
638
571
@@ -641,17 +574,11 @@ TEST_F(AArch64SelectionDAGTest, getTypeConversion_WidenScalableEVT) {
641
574
}
642
575
643
576
TEST_F (AArch64SelectionDAGTest, getTypeConversion_NoScalarizeEVT_nxv1f128) {
644
- if (!TM)
645
- return ;
646
-
647
577
EVT FromVT = EVT::getVectorVT (Context, MVT::f128, 1 , true );
648
578
EXPECT_DEATH (getTypeAction (FromVT), " Cannot legalize this vector" );
649
579
}
650
580
651
581
TEST_F (AArch64SelectionDAGTest, TestFold_STEP_VECTOR) {
652
- if (!TM)
653
- return ;
654
-
655
582
SDLoc Loc;
656
583
auto IntVT = EVT::getIntegerVT (Context, 8 );
657
584
auto VecVT = EVT::getVectorVT (Context, MVT::i8, 16 , true );
0 commit comments