diff --git a/llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp b/llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp --- a/llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp +++ b/llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp @@ -202,7 +202,7 @@ auto Vec = II.getArgOperand(0); auto Amt = II.getArgOperand(1); - auto VT = cast(Vec->getType()); + auto VT = cast(Vec->getType()); auto SVT = VT->getElementType(); auto AmtVT = Amt->getType(); unsigned VWidth = VT->getNumElements(); @@ -234,7 +234,7 @@ assert(AmtVT->isVectorTy() && AmtVT->getPrimitiveSizeInBits() == 128 && cast(AmtVT)->getElementType() == SVT && "Unexpected shift-by-scalar type"); - unsigned NumAmtElts = cast(AmtVT)->getNumElements(); + unsigned NumAmtElts = cast(AmtVT)->getNumElements(); APInt DemandedLower = APInt::getOneBitSet(NumAmtElts, 0); APInt DemandedUpper = APInt::getBitsSet(NumAmtElts, 1, NumAmtElts / 2); KnownBits KnownLowerBits = llvm::computeKnownBits( @@ -350,7 +350,7 @@ auto Vec = II.getArgOperand(0); auto Amt = II.getArgOperand(1); - auto VT = cast(II.getType()); + auto VT = cast(II.getType()); auto SVT = VT->getElementType(); int NumElts = VT->getNumElements(); int BitWidth = SVT->getIntegerBitWidth(); @@ -448,10 +448,10 @@ if (isa(Arg0) && isa(Arg1)) return UndefValue::get(ResTy); - auto *ArgTy = cast(Arg0->getType()); + auto *ArgTy = cast(Arg0->getType()); unsigned NumLanes = ResTy->getPrimitiveSizeInBits() / 128; unsigned NumSrcElts = ArgTy->getNumElements(); - assert(cast(ResTy)->getNumElements() == (2 * NumSrcElts) && + assert(cast(ResTy)->getNumElements() == (2 * NumSrcElts) && "Unexpected packing types"); unsigned NumSrcEltsPerLane = NumSrcElts / NumLanes; @@ -513,7 +513,7 @@ if (isa(Arg)) return Constant::getNullValue(ResTy); - auto *ArgTy = dyn_cast(Arg->getType()); + auto *ArgTy = dyn_cast(Arg->getType()); // We can't easily peek through x86_mmx types. if (!ArgTy) return nullptr; @@ -567,7 +567,7 @@ if (!CInt) return nullptr; - VectorType *VecTy = cast(II.getType()); + auto *VecTy = cast(II.getType()); assert(VecTy->getNumElements() == 4 && "insertps with wrong vector type"); // The immediate permute control byte looks like this: @@ -810,7 +810,7 @@ if (!V) return nullptr; - auto *VecTy = cast(II.getType()); + auto *VecTy = cast(II.getType()); unsigned NumElts = VecTy->getNumElements(); assert((NumElts == 16 || NumElts == 32 || NumElts == 64) && "Unexpected number of elements in shuffle mask!"); @@ -855,7 +855,7 @@ if (!V) return nullptr; - auto *VecTy = cast(II.getType()); + auto *VecTy = cast(II.getType()); unsigned NumElts = VecTy->getNumElements(); bool IsPD = VecTy->getScalarType()->isDoubleTy(); unsigned NumLaneElts = IsPD ? 2 : 4; @@ -903,7 +903,7 @@ if (!V) return nullptr; - auto *VecTy = cast(II.getType()); + auto *VecTy = cast(II.getType()); unsigned Size = VecTy->getNumElements(); assert((Size == 4 || Size == 8 || Size == 16 || Size == 32 || Size == 64) && "Unexpected shuffle mask size"); @@ -1084,7 +1084,7 @@ // These intrinsics only demand the 0th element of their input vectors. If // we can simplify the input based on that, do so now. Value *Arg = II.getArgOperand(0); - unsigned VWidth = cast(Arg->getType())->getNumElements(); + unsigned VWidth = cast(Arg->getType())->getNumElements(); if (Value *V = SimplifyDemandedVectorEltsLow(Arg, VWidth, 1)) { return IC.replaceOperand(II, 0, V); } @@ -1136,7 +1136,7 @@ bool MadeChange = false; Value *Arg0 = II.getArgOperand(0); Value *Arg1 = II.getArgOperand(1); - unsigned VWidth = cast(Arg0->getType())->getNumElements(); + unsigned VWidth = cast(Arg0->getType())->getNumElements(); if (Value *V = SimplifyDemandedVectorEltsLow(Arg0, VWidth, 1)) { IC.replaceOperand(II, 0, V); MadeChange = true; @@ -1362,7 +1362,7 @@ Value *Arg1 = II.getArgOperand(1); assert(Arg1->getType()->getPrimitiveSizeInBits() == 128 && "Unexpected packed shift size"); - unsigned VWidth = cast(Arg1->getType())->getNumElements(); + unsigned VWidth = cast(Arg1->getType())->getNumElements(); if (Value *V = SimplifyDemandedVectorEltsLow(Arg1, VWidth, VWidth / 2)) { return IC.replaceOperand(II, 1, V); @@ -1433,7 +1433,8 @@ bool MadeChange = false; Value *Arg0 = II.getArgOperand(0); Value *Arg1 = II.getArgOperand(1); - unsigned VWidth = cast(Arg0->getType())->getNumElements(); + unsigned VWidth = + cast(Arg0->getType())->getNumElements(); APInt UndefElts1(VWidth, 0); APInt DemandedElts1 = @@ -1476,8 +1477,8 @@ case Intrinsic::x86_sse4a_extrq: { Value *Op0 = II.getArgOperand(0); Value *Op1 = II.getArgOperand(1); - unsigned VWidth0 = cast(Op0->getType())->getNumElements(); - unsigned VWidth1 = cast(Op1->getType())->getNumElements(); + unsigned VWidth0 = cast(Op0->getType())->getNumElements(); + unsigned VWidth1 = cast(Op1->getType())->getNumElements(); assert(Op0->getType()->getPrimitiveSizeInBits() == 128 && Op1->getType()->getPrimitiveSizeInBits() == 128 && VWidth0 == 2 && VWidth1 == 16 && "Unexpected operand sizes"); @@ -1517,7 +1518,7 @@ // EXTRQI: Extract Length bits starting from Index. Zero pad the remaining // bits of the lower 64-bits. The upper 64-bits are undefined. Value *Op0 = II.getArgOperand(0); - unsigned VWidth = cast(Op0->getType())->getNumElements(); + unsigned VWidth = cast(Op0->getType())->getNumElements(); assert(Op0->getType()->getPrimitiveSizeInBits() == 128 && VWidth == 2 && "Unexpected operand size"); @@ -1541,10 +1542,10 @@ case Intrinsic::x86_sse4a_insertq: { Value *Op0 = II.getArgOperand(0); Value *Op1 = II.getArgOperand(1); - unsigned VWidth = cast(Op0->getType())->getNumElements(); + unsigned VWidth = cast(Op0->getType())->getNumElements(); assert(Op0->getType()->getPrimitiveSizeInBits() == 128 && Op1->getType()->getPrimitiveSizeInBits() == 128 && VWidth == 2 && - cast(Op1->getType())->getNumElements() == 2 && + cast(Op1->getType())->getNumElements() == 2 && "Unexpected operand size"); // See if we're dealing with constant values. @@ -1577,8 +1578,8 @@ // undefined. Value *Op0 = II.getArgOperand(0); Value *Op1 = II.getArgOperand(1); - unsigned VWidth0 = cast(Op0->getType())->getNumElements(); - unsigned VWidth1 = cast(Op1->getType())->getNumElements(); + unsigned VWidth0 = cast(Op0->getType())->getNumElements(); + unsigned VWidth1 = cast(Op1->getType())->getNumElements(); assert(Op0->getType()->getPrimitiveSizeInBits() == 128 && Op1->getType()->getPrimitiveSizeInBits() == 128 && VWidth0 == 2 && VWidth1 == 2 && "Unexpected operand sizes"); @@ -1650,9 +1651,9 @@ "Not expecting mask and operands with different sizes"); unsigned NumMaskElts = - cast(Mask->getType())->getNumElements(); + cast(Mask->getType())->getNumElements(); unsigned NumOperandElts = - cast(II.getType())->getNumElements(); + cast(II.getType())->getNumElements(); if (NumMaskElts == NumOperandElts) { return SelectInst::Create(BoolVec, Op1, Op0); } @@ -1768,7 +1769,7 @@ ArgWidth = 8; // Arg is x86_mmx, but treated as <8 x i8>. } else { auto Arg = II.getArgOperand(0); - auto ArgType = cast(Arg->getType()); + auto ArgType = cast(Arg->getType()); ArgWidth = ArgType->getNumElements(); } @@ -1934,7 +1935,7 @@ case Intrinsic::x86_avx512_packusdw_512: case Intrinsic::x86_avx512_packuswb_512: { auto *Ty0 = II.getArgOperand(0)->getType(); - unsigned InnerVWidth = cast(Ty0)->getNumElements(); + unsigned InnerVWidth = cast(Ty0)->getNumElements(); assert(VWidth == (InnerVWidth * 2) && "Unexpected input size"); unsigned NumLanes = Ty0->getPrimitiveSizeInBits() / 128;