File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -492,9 +492,9 @@ class VectorType : public Type {
492492 return VectorType::get (EltTy, VTy->getElementCount ());
493493 }
494494
495- // This static method returns a VectorType with a smaller number of elements
496- // of a larger type than the input element type. For example, a <16 x i8 >
497- // subdivided twice would return <4 x i32 >
495+ // This static method returns a VectorType with a larger number of elements
496+ // of a smaller type than the input element type. For example, a <4 x i64 >
497+ // subdivided twice would return <16 x i16 >
498498 static VectorType *getSubdividedVectorType (VectorType *VTy, int NumSubdivs) {
499499 for (int i = 0 ; i < NumSubdivs; ++i) {
500500 VTy = VectorType::getDoubleElementsVectorType (VTy);
Original file line number Diff line number Diff line change @@ -125,6 +125,10 @@ TEST(VectorTypesTest, FixedLength) {
125125 EltCnt = V8Int64Ty->getElementCount ();
126126 EXPECT_EQ (EltCnt.getKnownMinValue (), 8U );
127127 ASSERT_FALSE (EltCnt.isScalable ());
128+
129+ auto *SubTy = VectorType::getSubdividedVectorType (V4Int64Ty, 2 );
130+ EXPECT_EQ (SubTy->getElementCount (), ElementCount::getFixed (16 ));
131+ EXPECT_TRUE (SubTy->getElementType ()->isIntegerTy (16 ));
128132}
129133
130134TEST (VectorTypesTest, Scalable) {
You can’t perform that action at this time.
0 commit comments