@@ -336,7 +336,7 @@ bool SPIRVToLLVM::transOCLBuiltinFromVariable(GlobalVariable *GV,
336
336
std::vector<Value *> Vectors;
337
337
Loads.push_back (LD);
338
338
if (HasIndexArg) {
339
- auto *VecTy = cast<VectorType >(
339
+ auto *VecTy = cast<FixedVectorType >(
340
340
LD->getPointerOperandType ()->getPointerElementType ());
341
341
Value *EmptyVec = UndefValue::get (VecTy);
342
342
Vectors.push_back (EmptyVec);
@@ -1937,7 +1937,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
1937
1937
IRBuilder<> Builder (BB);
1938
1938
auto Scalar = transValue (VTS->getScalar (), F, BB);
1939
1939
auto Vector = transValue (VTS->getVector (), F, BB);
1940
- auto *VecTy = cast<VectorType >(Vector->getType ());
1940
+ auto *VecTy = cast<FixedVectorType >(Vector->getType ());
1941
1941
unsigned VecSize = VecTy->getNumElements ();
1942
1942
auto NewVec = Builder.CreateVectorSplat (VecSize, Scalar, Scalar->getName ());
1943
1943
NewVec->takeName (Scalar);
@@ -1965,8 +1965,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
1965
1965
1966
1966
unsigned M = Mat->getType ()->getArrayNumElements ();
1967
1967
1968
- auto *VecTy = cast<VectorType >(Vec->getType ());
1969
- VectorType *VTy = FixedVectorType::get (VecTy->getElementType (), M);
1968
+ auto *VecTy = cast<FixedVectorType >(Vec->getType ());
1969
+ FixedVectorType *VTy = FixedVectorType::get (VecTy->getElementType (), M);
1970
1970
auto ETy = VTy->getElementType ();
1971
1971
unsigned N = VecTy->getNumElements ();
1972
1972
Value *V = Builder.CreateVectorSplat (M, ConstantFP::get (ETy, 0.0 ));
@@ -1994,7 +1994,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
1994
1994
auto Matrix = transValue (MTS->getMatrix (), F, BB);
1995
1995
uint64_t ColNum = Matrix->getType ()->getArrayNumElements ();
1996
1996
auto ColType = cast<ArrayType>(Matrix->getType ())->getElementType ();
1997
- auto VecSize = cast<VectorType >(ColType)->getNumElements ();
1997
+ auto VecSize = cast<FixedVectorType >(ColType)->getNumElements ();
1998
1998
auto NewVec = Builder.CreateVectorSplat (VecSize, Scalar, Scalar->getName ());
1999
1999
NewVec->takeName (Scalar);
2000
2000
@@ -2031,8 +2031,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
2031
2031
// where sum is defined as vector sum.
2032
2032
2033
2033
unsigned M = Mat->getType ()->getArrayNumElements ();
2034
- VectorType *VTy =
2035
- cast<VectorType>(cast< ArrayType>(Mat->getType ())->getElementType ());
2034
+ FixedVectorType *VTy = cast<FixedVectorType>(
2035
+ cast<ArrayType>(Mat->getType ())->getElementType ());
2036
2036
unsigned N = VTy->getNumElements ();
2037
2037
auto ETy = VTy->getElementType ();
2038
2038
Value *V = Builder.CreateVectorSplat (N, ConstantFP::get (ETy, 0.0 ));
@@ -2086,10 +2086,10 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
2086
2086
2087
2087
unsigned C1 = M1->getType ()->getArrayNumElements ();
2088
2088
unsigned C2 = M2->getType ()->getArrayNumElements ();
2089
- VectorType *V1Ty =
2090
- cast<VectorType >(cast<ArrayType>(M1->getType ())->getElementType ());
2091
- VectorType *V2Ty =
2092
- cast<VectorType >(cast<ArrayType>(M2->getType ())->getElementType ());
2089
+ FixedVectorType *V1Ty =
2090
+ cast<FixedVectorType >(cast<ArrayType>(M1->getType ())->getElementType ());
2091
+ FixedVectorType *V2Ty =
2092
+ cast<FixedVectorType >(cast<ArrayType>(M2->getType ())->getElementType ());
2093
2093
unsigned R1 = V1Ty->getNumElements ();
2094
2094
unsigned R2 = V2Ty->getNumElements ();
2095
2095
auto ETy = V1Ty->getElementType ();
@@ -2127,8 +2127,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
2127
2127
IRBuilder<> Builder (BB);
2128
2128
auto Matrix = transValue (TR->getMatrix (), F, BB);
2129
2129
unsigned ColNum = Matrix->getType ()->getArrayNumElements ();
2130
- VectorType *ColTy =
2131
- cast<VectorType>(cast< ArrayType>(Matrix->getType ())->getElementType ());
2130
+ FixedVectorType *ColTy = cast<FixedVectorType>(
2131
+ cast<ArrayType>(Matrix->getType ())->getElementType ());
2132
2132
unsigned RowNum = ColTy->getNumElements ();
2133
2133
2134
2134
auto VTy = FixedVectorType::get (ColTy->getElementType (), ColNum);
@@ -4268,7 +4268,7 @@ Instruction *SPIRVToLLVM::transOCLAllAny(SPIRVInstruction *I, BasicBlock *BB) {
4268
4268
auto OldArg = CI->getOperand (0 );
4269
4269
auto NewArgTy = FixedVectorType::get (
4270
4270
Int32Ty,
4271
- cast<VectorType >(OldArg->getType ())->getNumElements ());
4271
+ cast<FixedVectorType >(OldArg->getType ())->getNumElements ());
4272
4272
auto NewArg =
4273
4273
CastInst::CreateSExtOrBitCast (OldArg, NewArgTy, " " , CI);
4274
4274
Args[0 ] = NewArg;
@@ -4294,16 +4294,17 @@ Instruction *SPIRVToLLVM::transOCLRelational(SPIRVInstruction *I,
4294
4294
Type *IntTy = Type::getInt32Ty (*Context);
4295
4295
RetTy = IntTy;
4296
4296
if (CI->getType ()->isVectorTy ()) {
4297
- if (cast<VectorType >(CI->getOperand (0 )->getType ())
4297
+ if (cast<FixedVectorType >(CI->getOperand (0 )->getType ())
4298
4298
->getElementType ()
4299
4299
->isDoubleTy ())
4300
4300
IntTy = Type::getInt64Ty (*Context);
4301
- if (cast<VectorType >(CI->getOperand (0 )->getType ())
4301
+ if (cast<FixedVectorType >(CI->getOperand (0 )->getType ())
4302
4302
->getElementType ()
4303
4303
->isHalfTy ())
4304
4304
IntTy = Type::getInt16Ty (*Context);
4305
4305
RetTy = FixedVectorType::get (
4306
- IntTy, cast<VectorType>(CI->getType ())->getNumElements ());
4306
+ IntTy,
4307
+ cast<FixedVectorType>(CI->getType ())->getNumElements ());
4307
4308
}
4308
4309
return CI->getCalledFunction ()->getName ().str ();
4309
4310
},
@@ -4312,7 +4313,7 @@ Instruction *SPIRVToLLVM::transOCLRelational(SPIRVInstruction *I,
4312
4313
if (NewCI->getType ()->isVectorTy ())
4313
4314
RetTy = FixedVectorType::get (
4314
4315
Type::getInt1Ty (*Context),
4315
- cast<VectorType >(NewCI->getType ())->getNumElements ());
4316
+ cast<FixedVectorType >(NewCI->getType ())->getNumElements ());
4316
4317
return CastInst::CreateTruncOrBitCast (NewCI, RetTy, " " ,
4317
4318
NewCI->getNextNode ());
4318
4319
},
0 commit comments