@@ -336,7 +336,7 @@ bool SPIRVToLLVM::transOCLBuiltinFromVariable(GlobalVariable *GV,
336336 std::vector<Value *> Vectors;
337337 Loads.push_back (LD);
338338 if (HasIndexArg) {
339- auto *VecTy = cast<VectorType >(
339+ auto *VecTy = cast<FixedVectorType >(
340340 LD->getPointerOperandType ()->getPointerElementType ());
341341 Value *EmptyVec = UndefValue::get (VecTy);
342342 Vectors.push_back (EmptyVec);
@@ -1937,7 +1937,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
19371937 IRBuilder<> Builder (BB);
19381938 auto Scalar = transValue (VTS->getScalar (), F, BB);
19391939 auto Vector = transValue (VTS->getVector (), F, BB);
1940- auto *VecTy = cast<VectorType >(Vector->getType ());
1940+ auto *VecTy = cast<FixedVectorType >(Vector->getType ());
19411941 unsigned VecSize = VecTy->getNumElements ();
19421942 auto NewVec = Builder.CreateVectorSplat (VecSize, Scalar, Scalar->getName ());
19431943 NewVec->takeName (Scalar);
@@ -1965,8 +1965,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
19651965
19661966 unsigned M = Mat->getType ()->getArrayNumElements ();
19671967
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);
19701970 auto ETy = VTy->getElementType ();
19711971 unsigned N = VecTy->getNumElements ();
19721972 Value *V = Builder.CreateVectorSplat (M, ConstantFP::get (ETy, 0.0 ));
@@ -1994,7 +1994,7 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
19941994 auto Matrix = transValue (MTS->getMatrix (), F, BB);
19951995 uint64_t ColNum = Matrix->getType ()->getArrayNumElements ();
19961996 auto ColType = cast<ArrayType>(Matrix->getType ())->getElementType ();
1997- auto VecSize = cast<VectorType >(ColType)->getNumElements ();
1997+ auto VecSize = cast<FixedVectorType >(ColType)->getNumElements ();
19981998 auto NewVec = Builder.CreateVectorSplat (VecSize, Scalar, Scalar->getName ());
19991999 NewVec->takeName (Scalar);
20002000
@@ -2031,8 +2031,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
20312031 // where sum is defined as vector sum.
20322032
20332033 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 ());
20362036 unsigned N = VTy->getNumElements ();
20372037 auto ETy = VTy->getElementType ();
20382038 Value *V = Builder.CreateVectorSplat (N, ConstantFP::get (ETy, 0.0 ));
@@ -2086,10 +2086,10 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
20862086
20872087 unsigned C1 = M1->getType ()->getArrayNumElements ();
20882088 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 ());
20932093 unsigned R1 = V1Ty->getNumElements ();
20942094 unsigned R2 = V2Ty->getNumElements ();
20952095 auto ETy = V1Ty->getElementType ();
@@ -2127,8 +2127,8 @@ Value *SPIRVToLLVM::transValueWithoutDecoration(SPIRVValue *BV, Function *F,
21272127 IRBuilder<> Builder (BB);
21282128 auto Matrix = transValue (TR->getMatrix (), F, BB);
21292129 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 ());
21322132 unsigned RowNum = ColTy->getNumElements ();
21332133
21342134 auto VTy = FixedVectorType::get (ColTy->getElementType (), ColNum);
@@ -4255,7 +4255,7 @@ Instruction *SPIRVToLLVM::transOCLAllAny(SPIRVInstruction *I, BasicBlock *BB) {
42554255 auto OldArg = CI->getOperand (0 );
42564256 auto NewArgTy = FixedVectorType::get (
42574257 Int32Ty,
4258- cast<VectorType >(OldArg->getType ())->getNumElements ());
4258+ cast<FixedVectorType >(OldArg->getType ())->getNumElements ());
42594259 auto NewArg =
42604260 CastInst::CreateSExtOrBitCast (OldArg, NewArgTy, " " , CI);
42614261 Args[0 ] = NewArg;
@@ -4281,16 +4281,17 @@ Instruction *SPIRVToLLVM::transOCLRelational(SPIRVInstruction *I,
42814281 Type *IntTy = Type::getInt32Ty (*Context);
42824282 RetTy = IntTy;
42834283 if (CI->getType ()->isVectorTy ()) {
4284- if (cast<VectorType >(CI->getOperand (0 )->getType ())
4284+ if (cast<FixedVectorType >(CI->getOperand (0 )->getType ())
42854285 ->getElementType ()
42864286 ->isDoubleTy ())
42874287 IntTy = Type::getInt64Ty (*Context);
4288- if (cast<VectorType >(CI->getOperand (0 )->getType ())
4288+ if (cast<FixedVectorType >(CI->getOperand (0 )->getType ())
42894289 ->getElementType ()
42904290 ->isHalfTy ())
42914291 IntTy = Type::getInt16Ty (*Context);
42924292 RetTy = FixedVectorType::get (
4293- IntTy, cast<VectorType>(CI->getType ())->getNumElements ());
4293+ IntTy,
4294+ cast<FixedVectorType>(CI->getType ())->getNumElements ());
42944295 }
42954296 return CI->getCalledFunction ()->getName ().str ();
42964297 },
@@ -4299,7 +4300,7 @@ Instruction *SPIRVToLLVM::transOCLRelational(SPIRVInstruction *I,
42994300 if (NewCI->getType ()->isVectorTy ())
43004301 RetTy = FixedVectorType::get (
43014302 Type::getInt1Ty (*Context),
4302- cast<VectorType >(NewCI->getType ())->getNumElements ());
4303+ cast<FixedVectorType >(NewCI->getType ())->getNumElements ());
43034304 return CastInst::CreateTruncOrBitCast (NewCI, RetTy, " " ,
43044305 NewCI->getNextNode ());
43054306 },
0 commit comments