@@ -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);
@@ -4255,7 +4255,7 @@ Instruction *SPIRVToLLVM::transOCLAllAny(SPIRVInstruction *I, BasicBlock *BB) {
4255
4255
auto OldArg = CI->getOperand (0 );
4256
4256
auto NewArgTy = FixedVectorType::get (
4257
4257
Int32Ty,
4258
- cast<VectorType >(OldArg->getType ())->getNumElements ());
4258
+ cast<FixedVectorType >(OldArg->getType ())->getNumElements ());
4259
4259
auto NewArg =
4260
4260
CastInst::CreateSExtOrBitCast (OldArg, NewArgTy, " " , CI);
4261
4261
Args[0 ] = NewArg;
@@ -4281,16 +4281,17 @@ Instruction *SPIRVToLLVM::transOCLRelational(SPIRVInstruction *I,
4281
4281
Type *IntTy = Type::getInt32Ty (*Context);
4282
4282
RetTy = IntTy;
4283
4283
if (CI->getType ()->isVectorTy ()) {
4284
- if (cast<VectorType >(CI->getOperand (0 )->getType ())
4284
+ if (cast<FixedVectorType >(CI->getOperand (0 )->getType ())
4285
4285
->getElementType ()
4286
4286
->isDoubleTy ())
4287
4287
IntTy = Type::getInt64Ty (*Context);
4288
- if (cast<VectorType >(CI->getOperand (0 )->getType ())
4288
+ if (cast<FixedVectorType >(CI->getOperand (0 )->getType ())
4289
4289
->getElementType ()
4290
4290
->isHalfTy ())
4291
4291
IntTy = Type::getInt16Ty (*Context);
4292
4292
RetTy = FixedVectorType::get (
4293
- IntTy, cast<VectorType>(CI->getType ())->getNumElements ());
4293
+ IntTy,
4294
+ cast<FixedVectorType>(CI->getType ())->getNumElements ());
4294
4295
}
4295
4296
return CI->getCalledFunction ()->getName ().str ();
4296
4297
},
@@ -4299,7 +4300,7 @@ Instruction *SPIRVToLLVM::transOCLRelational(SPIRVInstruction *I,
4299
4300
if (NewCI->getType ()->isVectorTy ())
4300
4301
RetTy = FixedVectorType::get (
4301
4302
Type::getInt1Ty (*Context),
4302
- cast<VectorType >(NewCI->getType ())->getNumElements ());
4303
+ cast<FixedVectorType >(NewCI->getType ())->getNumElements ());
4303
4304
return CastInst::CreateTruncOrBitCast (NewCI, RetTy, " " ,
4304
4305
NewCI->getNextNode ());
4305
4306
},
0 commit comments