Lines Matching defs:DestTy

217     auto *DestTy = dyn_cast<FixedVectorType>(Ty);
218 if (SrcTy && DestTy &&
219 SrcTy->getNumElements() == DestTy->getNumElements() &&
220 SrcTy->getPrimitiveSizeInBits() == DestTy->getPrimitiveSizeInBits()) {
221 Value *CastX = Builder.CreateCast(CI.getOpcode(), X, DestTy);
448 Type *DestTy = Trunc.getType();
449 unsigned NarrowWidth = DestTy->getScalarSizeInBits();
531 Value *NarrowShAmt = Builder.CreateZExtOrTrunc(ShAmt, DestTy);
534 X = Y = Builder.CreateTrunc(ShVal0, DestTy);
536 Y = Builder.CreateTrunc(ShVal1, DestTy);
538 Function *F = Intrinsic::getDeclaration(Trunc.getModule(), IID, DestTy);
546 Type *DestTy = Trunc.getType();
548 unsigned DestWidth = DestTy->getScalarSizeInBits();
550 if (!isa<VectorType>(SrcTy) && !shouldChangeType(SrcTy, DestTy))
569 Constant *NarrowC = ConstantExpr::getTrunc(C, DestTy);
570 Value *TruncX = Builder.CreateTrunc(BinOp1, DestTy);
575 Constant *NarrowC = ConstantExpr::getTrunc(C, DestTy);
576 Value *TruncX = Builder.CreateTrunc(BinOp0, DestTy);
580 if (match(BinOp0, m_ZExtOrSExt(m_Value(X))) && X->getType() == DestTy) {
582 Value *NarrowOp1 = Builder.CreateTrunc(BinOp1, DestTy);
585 if (match(BinOp1, m_ZExtOrSExt(m_Value(X))) && X->getType() == DestTy) {
587 Value *NarrowOp0 = Builder.CreateTrunc(BinOp0, DestTy);
612 return CastInst::CreateTruncOrBitCast(Shift, DestTy);
660 Type *DestTy = Trunc.getType();
661 Type *DestScalarTy = DestTy->getScalarType();
669 UndefValue *NarrowUndef = UndefValue::get(DestTy);
682 Type *DestTy = Trunc.getType(), *SrcTy = Src->getType();
683 unsigned DestWidth = DestTy->getScalarSizeInBits();
690 if ((DestTy->isVectorTy() || shouldChangeType(SrcTy, DestTy)) &&
691 canEvaluateTruncated(Src, DestTy, *this, &Trunc)) {
699 Value *Res = EvaluateInDifferentType(Src, DestTy, false);
700 assert(Res->getType() == DestTy);
708 if (auto *DestITy = dyn_cast<IntegerType>(DestTy)) {
718 return new TruncInst(Res, DestTy);
805 if (A->getType() == DestTy) {
816 return CastInst::CreateIntegerCast(Shift, DestTy, true);
832 (isa<VectorType>(SrcTy) || shouldChangeType(SrcTy, DestTy))) {
841 Value *NewTrunc = Builder.CreateTrunc(A, DestTy, A->getName() + ".tr");
843 ConstantExpr::getTrunc(C, DestTy));
876 VectorType::get(DestTy, BitCastNumElts, VecElts.isScalable());
901 Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
1150 Type *SrcTy = Src->getType(), *DestTy = Zext.getType();
1158 if (shouldChangeType(SrcTy, DestTy) &&
1159 canEvaluateZExtd(Src, DestTy, BitsToClear, *this, &Zext)) {
1168 Value *Res = EvaluateInDifferentType(Src, DestTy, false);
1169 assert(Res->getType() == DestTy);
1177 uint32_t DestBitSize = DestTy->getScalarSizeInBits();
1204 unsigned DstSize = DestTy->getScalarSizeInBits();
1213 return new ZExtInst(And, DestTy);
1222 Value *Trunc = Builder.CreateTrunc(A, DestTy);
1237 X->getType() == DestTy)
1238 return BinaryOperator::CreateAnd(X, Builder.CreateZExt(C, DestTy));
1244 X->getType() == DestTy) {
1245 Value *ZC = Builder.CreateZExt(C, DestTy);
1255 X->getType() == DestTy) {
1256 Value *ZextC = Builder.CreateZExt(C, DestTy);
1268 Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
1279 Log2_64_Ceil(DestTy->getScalarSizeInBits()) &&
1438 Type *SrcTy = Src->getType(), *DestTy = Sext.getType();
1440 unsigned DestBitSize = DestTy->getScalarSizeInBits();
1444 auto CI = CastInst::Create(Instruction::ZExt, Src, DestTy);
1450 if (shouldChangeType(SrcTy, DestTy) && canEvaluateSExtd(Src, DestTy)) {
1456 Value *Res = EvaluateInDifferentType(Src, DestTy, true);
1457 assert(Res->getType() == DestTy);
1465 Value *ShAmt = ConstantInt::get(DestTy, DestBitSize-SrcBitSize);
1476 return CastInst::CreateIntegerCast(X, DestTy, /* isSigned */ true);
1479 if (Src->hasOneUse() && X->getType() == DestTy) {
1481 Constant *ShAmt = ConstantInt::get(DestTy, DestBitSize - SrcBitSize);
1494 return CastInst::CreateIntegerCast(Ashr, DestTy, /* isSigned */ true);
1519 BA->isElementWiseEqual(CA) && A->getType() == DestTy) {
1521 ConstantFoldCastOperand(Instruction::SExt, CA, DestTy, DL);
1524 ConstantInt::get(DestTy, SrcTy->getScalarSizeInBits()), WideCurrShAmt);
1526 ConstantInt::get(DestTy, DestTy->getScalarSizeInBits()),
1543 if (XTy == DestTy)
1548 return CastInst::CreateIntegerCast(Ashr, DestTy, /* isSigned */ true);
1559 Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
2112 optimizeVectorResizeWithIntegerBitCasts(Value *InVal, VectorType *DestTy,
2119 if (SrcTy->getElementType() != DestTy->getElementType()) {
2125 DestTy->getElementType()->getPrimitiveSizeInBits())
2129 FixedVectorType::get(DestTy->getElementType(),
2136 unsigned DestElts = cast<FixedVectorType>(DestTy)->getNumElements();
2372 Type *DestTy = BitCast.getType();
2382 if (!DestTy->isVectorTy() || !BO->getType()->isVectorTy())
2385 if (DestTy->isFPOrFPVectorTy()) {
2395 return CastInst::CreateBitOrPointerCast(NewBO, DestTy);
2402 return CastInst::CreateBitOrPointerCast(NewBO, DestTy);
2408 if (!DestTy->isIntOrIntVectorTy())
2413 X->getType() == DestTy && !isa<Constant>(X)) {
2415 Value *CastedOp1 = Builder.CreateBitCast(BO->getOperand(1), DestTy);
2420 X->getType() == DestTy && !isa<Constant>(X)) {
2422 Value *CastedOp0 = Builder.CreateBitCast(BO->getOperand(0), DestTy);
2433 Value *CastedOp0 = Builder.CreateBitCast(BO->getOperand(0), DestTy);
2434 Value *CastedC = Builder.CreateBitCast(C, DestTy);
2451 Type *DestTy = BitCast.getType();
2453 if (!DestTy->isVectorTy() ||
2455 cast<VectorType>(DestTy)->getElementCount())
2462 if (DestTy->isVectorTy() != TVal->getType()->isVectorTy())
2467 if (match(TVal, m_OneUse(m_BitCast(m_Value(X)))) && X->getType() == DestTy &&
2470 Value *CastedVal = Builder.CreateBitCast(FVal, DestTy);
2474 if (match(FVal, m_OneUse(m_BitCast(m_Value(X)))) && X->getType() == DestTy &&
2477 Value *CastedVal = Builder.CreateBitCast(TVal, DestTy);
2509 Type *DestTy = CI.getType(); // Type A
2538 if (DestTy->isX86_AMXTy())
2561 if (TyA != DestTy || TyB != SrcTy)
2577 if (TyA != DestTy || TyB != SrcTy)
2595 PHINode *NewPN = Builder.CreatePHI(DestTy, OldPN->getNumOperands());
2606 NewV = ConstantExpr::getBitCast(C, DestTy);
2611 NewV = combineLoadToNewType(*LI, DestTy);
2651 assert(TyA == DestTy && TyB == SrcTy);
2674 Type *DestTy = CI.getType();
2678 if (DestTy == Src->getType())
2681 if (FixedVectorType *DestVTy = dyn_cast<FixedVectorType>(DestTy)) {
2685 return InsertElementInst::Create(PoisonValue::get(DestTy), Elem,
2698 BCIn->getOperand(0), cast<VectorType>(DestTy), *this))
2714 if (!DestTy->isVectorTy()) {
2718 return CastInst::Create(Instruction::BitCast, Elem, DestTy);
2725 return new BitCastInst(InsElt->getOperand(1), DestTy);
2729 unsigned BitWidth = DestTy->getScalarSizeInBits();
2734 DestTy->isIntegerTy() && X->getType() == DestTy &&
2747 Value *ZextY = Builder.CreateZExt(Y, DestTy);
2760 if (Shuf->hasOneUse() && DestTy->isVectorTy() &&
2761 cast<VectorType>(DestTy)->getElementCount() == ShufElts &&
2768 Tmp->getOperand(0)->getType() == DestTy) ||
2770 Tmp->getOperand(0)->getType() == DestTy)) {
2771 Value *LHS = Builder.CreateBitCast(ShufOp0, DestTy);
2772 Value *RHS = Builder.CreateBitCast(ShufOp1, DestTy);
2783 if (DestTy->isIntegerTy() && ShufElts.getKnownMinValue() % 2 == 0 &&
2786 if (DL.isLegalInteger(DestTy->getScalarSizeInBits()) &&
2796 Intrinsic::getDeclaration(CI.getModule(), IntrinsicNum, DestTy);
2797 Value *ScalarX = Builder.CreateBitCast(ShufOp0, DestTy);