@@ -17,7 +17,7 @@ namespace {
1717
1818class VectorUtilsTest : public ::testing::Test {};
1919
20- TEST (VectorUtilsTest, TestToWideTy ) {
20+ TEST (VectorUtilsTest, TestToVectorizedTy ) {
2121 LLVMContext C;
2222
2323 Type *ITy = Type::getInt32Ty (C);
@@ -28,15 +28,15 @@ TEST(VectorUtilsTest, TestToWideTy) {
2828
2929 for (ElementCount VF :
3030 {ElementCount::getFixed (4 ), ElementCount::getScalable (2 )}) {
31- Type *IntVec = ToWideTy (ITy, VF);
31+ Type *IntVec = toVectorizedTy (ITy, VF);
3232 EXPECT_TRUE (isa<VectorType>(IntVec));
3333 EXPECT_EQ (IntVec, VectorType::get (ITy, VF));
3434
35- Type *FloatVec = ToWideTy (FTy, VF);
35+ Type *FloatVec = toVectorizedTy (FTy, VF);
3636 EXPECT_TRUE (isa<VectorType>(FloatVec));
3737 EXPECT_EQ (FloatVec, VectorType::get (FTy, VF));
3838
39- Type *WideHomogeneousStructTy = ToWideTy (HomogeneousStructTy, VF);
39+ Type *WideHomogeneousStructTy = toVectorizedTy (HomogeneousStructTy, VF);
4040 EXPECT_TRUE (isa<StructType>(WideHomogeneousStructTy));
4141 EXPECT_TRUE (
4242 cast<StructType>(WideHomogeneousStructTy)->containsHomogeneousTypes ());
@@ -45,24 +45,24 @@ TEST(VectorUtilsTest, TestToWideTy) {
4545 EXPECT_TRUE (cast<StructType>(WideHomogeneousStructTy)->getElementType (0 ) ==
4646 VectorType::get (FTy, VF));
4747
48- Type *WideMixedStructTy = ToWideTy (MixedStructTy, VF);
48+ Type *WideMixedStructTy = toVectorizedTy (MixedStructTy, VF);
4949 EXPECT_TRUE (isa<StructType>(WideMixedStructTy));
5050 EXPECT_TRUE (cast<StructType>(WideMixedStructTy)->getNumElements () == 2 );
5151 EXPECT_TRUE (cast<StructType>(WideMixedStructTy)->getElementType (0 ) ==
5252 VectorType::get (FTy, VF));
5353 EXPECT_TRUE (cast<StructType>(WideMixedStructTy)->getElementType (1 ) ==
5454 VectorType::get (ITy, VF));
5555
56- EXPECT_EQ (ToWideTy (VoidTy, VF), VoidTy);
56+ EXPECT_EQ (toVectorizedTy (VoidTy, VF), VoidTy);
5757 }
5858
5959 ElementCount ScalarVF = ElementCount::getFixed (1 );
6060 for (Type *Ty : {ITy, FTy, HomogeneousStructTy, MixedStructTy, VoidTy}) {
61- EXPECT_EQ (ToWideTy (Ty, ScalarVF), Ty);
61+ EXPECT_EQ (toVectorizedTy (Ty, ScalarVF), Ty);
6262 }
6363}
6464
65- TEST (VectorUtilsTest, TestToNarrowTy ) {
65+ TEST (VectorUtilsTest, TestToScalarizedTy ) {
6666 LLVMContext C;
6767
6868 Type *ITy = Type::getInt32Ty (C);
@@ -74,8 +74,8 @@ TEST(VectorUtilsTest, TestToNarrowTy) {
7474 for (ElementCount VF : {ElementCount::getFixed (1 ), ElementCount::getFixed (4 ),
7575 ElementCount::getScalable (2 )}) {
7676 for (Type *Ty : {ITy, FTy, HomogeneousStructTy, MixedStructTy, VoidTy}) {
77- // ToNarrowTy should be the inverse of ToWideTy .
78- EXPECT_EQ (ToNarrowTy ( ToWideTy (Ty, VF)), Ty);
77+ // toScalarizedTy should be the inverse of toVectorizedTy .
78+ EXPECT_EQ (toScalarizedTy ( toVectorizedTy (Ty, VF)), Ty);
7979 };
8080 }
8181}
@@ -97,40 +97,40 @@ TEST(VectorUtilsTest, TestGetContainedTypes) {
9797 EXPECT_EQ (getContainedTypes (MixedStructTy), ArrayRef<Type *>({FTy, ITy}));
9898}
9999
100- TEST (VectorUtilsTest, TestIsWideTy ) {
100+ TEST (VectorUtilsTest, TestIsVectorizedTy ) {
101101 LLVMContext C;
102102
103103 Type *ITy = Type::getInt32Ty (C);
104104 Type *FTy = Type::getFloatTy (C);
105105 Type *NarrowStruct = StructType::get (FTy, ITy);
106106 Type *VoidTy = Type::getVoidTy (C);
107107
108- EXPECT_FALSE (isWideTy (ITy));
109- EXPECT_FALSE (isWideTy (NarrowStruct));
110- EXPECT_FALSE (isWideTy (VoidTy));
108+ EXPECT_FALSE (isVectorizedTy (ITy));
109+ EXPECT_FALSE (isVectorizedTy (NarrowStruct));
110+ EXPECT_FALSE (isVectorizedTy (VoidTy));
111111
112112 ElementCount VF = ElementCount::getFixed (4 );
113- EXPECT_TRUE (isWideTy ( ToWideTy (ITy, VF)));
114- EXPECT_TRUE (isWideTy ( ToWideTy (NarrowStruct, VF)));
113+ EXPECT_TRUE (isVectorizedTy ( toVectorizedTy (ITy, VF)));
114+ EXPECT_TRUE (isVectorizedTy ( toVectorizedTy (NarrowStruct, VF)));
115115
116116 Type *MixedVFStruct =
117117 StructType::get (VectorType::get (ITy, ElementCount::getFixed (2 )),
118118 VectorType::get (ITy, ElementCount::getFixed (4 )));
119- EXPECT_FALSE (isWideTy (MixedVFStruct));
119+ EXPECT_FALSE (isVectorizedTy (MixedVFStruct));
120120
121121 // Currently only literals types are considered wide.
122122 Type *NamedWideStruct = StructType::create (" Named" , VectorType::get (ITy, VF),
123123 VectorType::get (ITy, VF));
124- EXPECT_FALSE (isWideTy (NamedWideStruct));
124+ EXPECT_FALSE (isVectorizedTy (NamedWideStruct));
125125
126126 // Currently only unpacked types are considered wide.
127127 Type *PackedWideStruct = StructType::get (
128128 C, ArrayRef<Type *>{VectorType::get (ITy, VF), VectorType::get (ITy, VF)},
129129 /* isPacked=*/ true );
130- EXPECT_FALSE (isWideTy (PackedWideStruct));
130+ EXPECT_FALSE (isVectorizedTy (PackedWideStruct));
131131}
132132
133- TEST (VectorUtilsTest, TestGetWideTypeVF ) {
133+ TEST (VectorUtilsTest, TestGetVectorizedTypeVF ) {
134134 LLVMContext C;
135135
136136 Type *ITy = Type::getInt32Ty (C);
@@ -141,7 +141,7 @@ TEST(VectorUtilsTest, TestGetWideTypeVF) {
141141 for (ElementCount VF :
142142 {ElementCount::getFixed (4 ), ElementCount::getScalable (2 )}) {
143143 for (Type *Ty : {ITy, FTy, HomogeneousStructTy, MixedStructTy}) {
144- EXPECT_EQ (getWideTypeVF ( ToWideTy (Ty, VF)), VF);
144+ EXPECT_EQ (getVectorizedTypeVF ( toVectorizedTy (Ty, VF)), VF);
145145 };
146146 }
147147}
0 commit comments