@@ -44,6 +44,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4444
4545using namespace llvm ;
4646using namespace IGC ;
47+ using IGCLLVM::FixedVectorType;
4748
4849//
4950// Description of VectorPreProcess Pass
@@ -562,7 +563,7 @@ void VectorPreProcess::createSplitVectorTypes(
562563 uint32_t M = N / E; // the number of subvectors for split size E
563564 if (M > 0 )
564565 {
565- Type* Ty = (E == 1 ) ? ETy : VectorType ::get (ETy, E);
566+ Type* Ty = (E == 1 ) ? ETy : FixedVectorType ::get (ETy, E);
566567 SplitInfo.push_back (std::make_pair (Ty, M));
567568 }
568569 N = N % E;
@@ -576,7 +577,7 @@ void VectorPreProcess::createSplitVectorTypes(
576577 M = N / E; // the number of subvectors for split size E
577578 if (M > 0 )
578579 {
579- SplitInfo.push_back (std::make_pair (VectorType ::get (ETy, E), M));
580+ SplitInfo.push_back (std::make_pair (FixedVectorType ::get (ETy, E), M));
580581 }
581582 // The remaining elts are to be split for next iteration.
582583 N = N % E;
@@ -586,7 +587,7 @@ void VectorPreProcess::createSplitVectorTypes(
586587 // 3. A vector of 1|2|3|4 elements. No further splitting!
587588 if (N > 0 )
588589 {
589- Type* Ty = (N == 1 ) ? ETy : VectorType ::get (ETy, N);
590+ Type* Ty = (N == 1 ) ? ETy : FixedVectorType ::get (ETy, N);
590591 SplitInfo.push_back (std::make_pair (Ty, 1 ));
591592 }
592593}
@@ -682,7 +683,7 @@ bool VectorPreProcess::splitStore(
682683 std::vector<Value*> splitScalars;
683684 IGC_ASSERT (Ty1->getScalarSizeInBits ());
684685 const uint32_t vectorSize = (unsigned int )ETy->getPrimitiveSizeInBits () / Ty1->getScalarSizeInBits ();
685- Type* splitType = llvm::VectorType ::get (Ty1, vectorSize);
686+ Type* splitType = FixedVectorType ::get (Ty1, vectorSize);
686687 for (uint32_t i = 0 ; i < nelts; i++)
687688 {
688689 Value* splitInst = aBuilder.CreateBitCast (scalars[i], splitType);
@@ -883,7 +884,7 @@ bool VectorPreProcess::splitLoad(
883884 {
884885 builder.SetInsertPoint (nextInst);
885886 }
886- Value* undef = UndefValue::get (VectorType ::get (svals[0 ]->getType (), scalarsPerElement));
887+ Value* undef = UndefValue::get (FixedVectorType ::get (svals[0 ]->getType (), scalarsPerElement));
887888 for (uint32_t i = 0 ; i < svals.size () / scalarsPerElement; i++)
888889 {
889890 Value* newElement = undef;
@@ -1000,7 +1001,7 @@ bool VectorPreProcess::splitVector3LoadStore(Instruction* Inst)
10001001 if (ALI->getAlignment () >= 4 * etyBytes)
10011002 {
10021003 // Make it 4-element load
1003- Type* newVTy = VectorType ::get (eTy, 4 );
1004+ Type* newVTy = FixedVectorType ::get (eTy, 4 );
10041005 Value* V = ALI->Create (newVTy);
10051006
10061007 Elt0 = Builder.CreateExtractElement (V, Builder.getInt32 (0 ), " elt0" );
@@ -1010,7 +1011,7 @@ bool VectorPreProcess::splitVector3LoadStore(Instruction* Inst)
10101011 else
10111012 {
10121013 // One 2-element vector load + one scalar load
1013- Type* newVTy = VectorType ::get (eTy, 2 );
1014+ Type* newVTy = FixedVectorType ::get (eTy, 2 );
10141015 Value* offsetAddr = ALI->CreateConstScalarGEP (eTy, ALI->getPointerOperand (), 2 );
10151016 Value* V2 = ALI->Create (newVTy);
10161017 Elt0 = Builder.CreateExtractElement (V2, Builder.getInt32 (0 ), " elt0" );
@@ -1058,7 +1059,7 @@ bool VectorPreProcess::splitVector3LoadStore(Instruction* Inst)
10581059 {
10591060 Value* Ptr = ASI->getPointerOperand ();
10601061 // Split 3-element into 2-element + 1 scalar
1061- Type* newVTy = VectorType ::get (eTy, 2 );
1062+ Type* newVTy = FixedVectorType ::get (eTy, 2 );
10621063 Value* StoredVal = ASI->getValueOperand ();
10631064 Value* offsetAddr = ASI->CreateConstScalarGEP (StoredVal->getType (), Ptr, 2 );
10641065 InsertElementInst* IEInsts[3 ];
@@ -1301,7 +1302,7 @@ Instruction* VectorPreProcess::simplifyLoadStore(Instruction* Inst)
13011302 if (N == MaxIndex + 1 )
13021303 return Inst;
13031304
1304- Type* NewVecTy = IGCLLVM:: FixedVectorType::get (cast<VectorType>(Inst->getType ())->getElementType (),
1305+ Type* NewVecTy = FixedVectorType::get (cast<VectorType>(Inst->getType ())->getElementType (),
13051306 MaxIndex + 1 );
13061307 IRBuilder<> Builder (Inst);
13071308 Instruction* NewLI = ALI.Create (NewVecTy);
@@ -1413,7 +1414,7 @@ Instruction* VectorPreProcess::simplifyLoadStore(Instruction* Inst)
14131414 if (MaxIndex >= 0 && MaxIndex + 1 < (int )N && isa<UndefValue>(ChainVal))
14141415 {
14151416 IRBuilder<> Builder (ASI.getInst ());
1416- Type* NewVecTy = VectorType ::get (cast<VectorType>(Val->getType ())->getElementType (),
1417+ Type* NewVecTy = FixedVectorType ::get (cast<VectorType>(Val->getType ())->getElementType (),
14171418 MaxIndex + 1 );
14181419 Value* SVal = UndefValue::get (NewVecTy);
14191420 for (int i = 0 ; i <= MaxIndex; ++i)
0 commit comments