@@ -44,6 +44,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
44
45
45
using namespace llvm ;
46
46
using namespace IGC ;
47
+ using IGCLLVM::FixedVectorType;
47
48
48
49
//
49
50
// Description of VectorPreProcess Pass
@@ -562,7 +563,7 @@ void VectorPreProcess::createSplitVectorTypes(
562
563
uint32_t M = N / E; // the number of subvectors for split size E
563
564
if (M > 0 )
564
565
{
565
- Type* Ty = (E == 1 ) ? ETy : VectorType ::get (ETy, E);
566
+ Type* Ty = (E == 1 ) ? ETy : FixedVectorType ::get (ETy, E);
566
567
SplitInfo.push_back (std::make_pair (Ty, M));
567
568
}
568
569
N = N % E;
@@ -576,7 +577,7 @@ void VectorPreProcess::createSplitVectorTypes(
576
577
M = N / E; // the number of subvectors for split size E
577
578
if (M > 0 )
578
579
{
579
- SplitInfo.push_back (std::make_pair (VectorType ::get (ETy, E), M));
580
+ SplitInfo.push_back (std::make_pair (FixedVectorType ::get (ETy, E), M));
580
581
}
581
582
// The remaining elts are to be split for next iteration.
582
583
N = N % E;
@@ -586,7 +587,7 @@ void VectorPreProcess::createSplitVectorTypes(
586
587
// 3. A vector of 1|2|3|4 elements. No further splitting!
587
588
if (N > 0 )
588
589
{
589
- Type* Ty = (N == 1 ) ? ETy : VectorType ::get (ETy, N);
590
+ Type* Ty = (N == 1 ) ? ETy : FixedVectorType ::get (ETy, N);
590
591
SplitInfo.push_back (std::make_pair (Ty, 1 ));
591
592
}
592
593
}
@@ -682,7 +683,7 @@ bool VectorPreProcess::splitStore(
682
683
std::vector<Value*> splitScalars;
683
684
IGC_ASSERT (Ty1->getScalarSizeInBits ());
684
685
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);
686
687
for (uint32_t i = 0 ; i < nelts; i++)
687
688
{
688
689
Value* splitInst = aBuilder.CreateBitCast (scalars[i], splitType);
@@ -883,7 +884,7 @@ bool VectorPreProcess::splitLoad(
883
884
{
884
885
builder.SetInsertPoint (nextInst);
885
886
}
886
- Value* undef = UndefValue::get (VectorType ::get (svals[0 ]->getType (), scalarsPerElement));
887
+ Value* undef = UndefValue::get (FixedVectorType ::get (svals[0 ]->getType (), scalarsPerElement));
887
888
for (uint32_t i = 0 ; i < svals.size () / scalarsPerElement; i++)
888
889
{
889
890
Value* newElement = undef;
@@ -1000,7 +1001,7 @@ bool VectorPreProcess::splitVector3LoadStore(Instruction* Inst)
1000
1001
if (ALI->getAlignment () >= 4 * etyBytes)
1001
1002
{
1002
1003
// Make it 4-element load
1003
- Type* newVTy = VectorType ::get (eTy, 4 );
1004
+ Type* newVTy = FixedVectorType ::get (eTy, 4 );
1004
1005
Value* V = ALI->Create (newVTy);
1005
1006
1006
1007
Elt0 = Builder.CreateExtractElement (V, Builder.getInt32 (0 ), " elt0" );
@@ -1010,7 +1011,7 @@ bool VectorPreProcess::splitVector3LoadStore(Instruction* Inst)
1010
1011
else
1011
1012
{
1012
1013
// One 2-element vector load + one scalar load
1013
- Type* newVTy = VectorType ::get (eTy, 2 );
1014
+ Type* newVTy = FixedVectorType ::get (eTy, 2 );
1014
1015
Value* offsetAddr = ALI->CreateConstScalarGEP (eTy, ALI->getPointerOperand (), 2 );
1015
1016
Value* V2 = ALI->Create (newVTy);
1016
1017
Elt0 = Builder.CreateExtractElement (V2, Builder.getInt32 (0 ), " elt0" );
@@ -1058,7 +1059,7 @@ bool VectorPreProcess::splitVector3LoadStore(Instruction* Inst)
1058
1059
{
1059
1060
Value* Ptr = ASI->getPointerOperand ();
1060
1061
// Split 3-element into 2-element + 1 scalar
1061
- Type* newVTy = VectorType ::get (eTy, 2 );
1062
+ Type* newVTy = FixedVectorType ::get (eTy, 2 );
1062
1063
Value* StoredVal = ASI->getValueOperand ();
1063
1064
Value* offsetAddr = ASI->CreateConstScalarGEP (StoredVal->getType (), Ptr, 2 );
1064
1065
InsertElementInst* IEInsts[3 ];
@@ -1301,7 +1302,7 @@ Instruction* VectorPreProcess::simplifyLoadStore(Instruction* Inst)
1301
1302
if (N == MaxIndex + 1 )
1302
1303
return Inst;
1303
1304
1304
- Type* NewVecTy = IGCLLVM:: FixedVectorType::get (cast<VectorType>(Inst->getType ())->getElementType (),
1305
+ Type* NewVecTy = FixedVectorType::get (cast<VectorType>(Inst->getType ())->getElementType (),
1305
1306
MaxIndex + 1 );
1306
1307
IRBuilder<> Builder (Inst);
1307
1308
Instruction* NewLI = ALI.Create (NewVecTy);
@@ -1413,7 +1414,7 @@ Instruction* VectorPreProcess::simplifyLoadStore(Instruction* Inst)
1413
1414
if (MaxIndex >= 0 && MaxIndex + 1 < (int )N && isa<UndefValue>(ChainVal))
1414
1415
{
1415
1416
IRBuilder<> Builder (ASI.getInst ());
1416
- Type* NewVecTy = VectorType ::get (cast<VectorType>(Val->getType ())->getElementType (),
1417
+ Type* NewVecTy = FixedVectorType ::get (cast<VectorType>(Val->getType ())->getElementType (),
1417
1418
MaxIndex + 1 );
1418
1419
Value* SVal = UndefValue::get (NewVecTy);
1419
1420
for (int i = 0 ; i <= MaxIndex; ++i)
0 commit comments