@@ -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);
@@ -4268,7 +4268,7 @@ Instruction *SPIRVToLLVM::transOCLAllAny(SPIRVInstruction *I, BasicBlock *BB) {
42684268 auto OldArg = CI->getOperand (0 );
42694269 auto NewArgTy = FixedVectorType::get (
42704270 Int32Ty,
4271- cast<VectorType >(OldArg->getType ())->getNumElements ());
4271+ cast<FixedVectorType >(OldArg->getType ())->getNumElements ());
42724272 auto NewArg =
42734273 CastInst::CreateSExtOrBitCast (OldArg, NewArgTy, " " , CI);
42744274 Args[0 ] = NewArg;
@@ -4294,16 +4294,17 @@ Instruction *SPIRVToLLVM::transOCLRelational(SPIRVInstruction *I,
42944294 Type *IntTy = Type::getInt32Ty (*Context);
42954295 RetTy = IntTy;
42964296 if (CI->getType ()->isVectorTy ()) {
4297- if (cast<VectorType >(CI->getOperand (0 )->getType ())
4297+ if (cast<FixedVectorType >(CI->getOperand (0 )->getType ())
42984298 ->getElementType ()
42994299 ->isDoubleTy ())
43004300 IntTy = Type::getInt64Ty (*Context);
4301- if (cast<VectorType >(CI->getOperand (0 )->getType ())
4301+ if (cast<FixedVectorType >(CI->getOperand (0 )->getType ())
43024302 ->getElementType ()
43034303 ->isHalfTy ())
43044304 IntTy = Type::getInt16Ty (*Context);
43054305 RetTy = FixedVectorType::get (
4306- IntTy, cast<VectorType>(CI->getType ())->getNumElements ());
4306+ IntTy,
4307+ cast<FixedVectorType>(CI->getType ())->getNumElements ());
43074308 }
43084309 return CI->getCalledFunction ()->getName ().str ();
43094310 },
@@ -4312,7 +4313,7 @@ Instruction *SPIRVToLLVM::transOCLRelational(SPIRVInstruction *I,
43124313 if (NewCI->getType ()->isVectorTy ())
43134314 RetTy = FixedVectorType::get (
43144315 Type::getInt1Ty (*Context),
4315- cast<VectorType >(NewCI->getType ())->getNumElements ());
4316+ cast<FixedVectorType >(NewCI->getType ())->getNumElements ());
43164317 return CastInst::CreateTruncOrBitCast (NewCI, RetTy, " " ,
43174318 NewCI->getNextNode ());
43184319 },
0 commit comments