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);
513 Type *DestTy = Trunc.getType();
514 unsigned NarrowWidth = DestTy->getScalarSizeInBits();
596 Value *NarrowShAmt = Builder.CreateZExtOrTrunc(ShAmt, DestTy);
599 X = Y = Builder.CreateTrunc(ShVal0, DestTy);
601 Y = Builder.CreateTrunc(ShVal1, DestTy);
604 Intrinsic::getOrInsertDeclaration(Trunc.getModule(), IID, DestTy);
612 Type *DestTy = Trunc.getType();
614 unsigned DestWidth = DestTy->getScalarSizeInBits();
616 if (!isa<VectorType>(SrcTy) && !shouldChangeType(SrcTy, DestTy))
635 Constant *NarrowC = ConstantExpr::getTrunc(C, DestTy);
636 Value *TruncX = Builder.CreateTrunc(BinOp1, DestTy);
641 Constant *NarrowC = ConstantExpr::getTrunc(C, DestTy);
642 Value *TruncX = Builder.CreateTrunc(BinOp0, DestTy);
646 if (match(BinOp0, m_ZExtOrSExt(m_Value(X))) && X->getType() == DestTy) {
648 Value *NarrowOp1 = Builder.CreateTrunc(BinOp1, DestTy);
651 if (match(BinOp1, m_ZExtOrSExt(m_Value(X))) && X->getType() == DestTy) {
653 Value *NarrowOp0 = Builder.CreateTrunc(BinOp0, DestTy);
678 return CastInst::CreateTruncOrBitCast(Shift, DestTy);
726 Type *DestTy = Trunc.getType();
727 Type *DestScalarTy = DestTy->getScalarType();
735 UndefValue *NarrowUndef = UndefValue::get(DestTy);
748 Type *DestTy = Trunc.getType(), *SrcTy = Src->getType();
749 unsigned DestWidth = DestTy->getScalarSizeInBits();
756 if ((DestTy->isVectorTy() || shouldChangeType(SrcTy, DestTy)) &&
757 canEvaluateTruncated(Src, DestTy, *this, &Trunc)) {
765 Value *Res = EvaluateInDifferentType(Src, DestTy, false);
766 assert(Res->getType() == DestTy);
774 if (auto *DestITy = dyn_cast<IntegerType>(DestTy)) {
784 return new TruncInst(Res, DestTy);
862 if (A->getType() == DestTy) {
873 return CastInst::CreateIntegerCast(Shift, DestTy, true);
889 (isa<VectorType>(SrcTy) || shouldChangeType(SrcTy, DestTy))) {
898 Value *NewTrunc = Builder.CreateTrunc(A, DestTy, A->getName() + ".tr");
900 ConstantExpr::getTrunc(C, DestTy));
930 Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
940 return replaceInstUsesWith(Trunc, ConstantInt::getTrue(DestTy));
1191 Type *SrcTy = Src->getType(), *DestTy = Zext.getType();
1199 if (shouldChangeType(SrcTy, DestTy) &&
1200 canEvaluateZExtd(Src, DestTy, BitsToClear, *this, &Zext)) {
1209 Value *Res = EvaluateInDifferentType(Src, DestTy, false);
1210 assert(Res->getType() == DestTy);
1218 uint32_t DestBitSize = DestTy->getScalarSizeInBits();
1245 unsigned DstSize = DestTy->getScalarSizeInBits();
1254 return new ZExtInst(And, DestTy);
1263 Value *Trunc = Builder.CreateTrunc(A, DestTy);
1278 X->getType() == DestTy)
1279 return BinaryOperator::CreateAnd(X, Builder.CreateZExt(C, DestTy));
1285 X->getType() == DestTy) {
1286 Value *ZC = Builder.CreateZExt(C, DestTy);
1296 X->getType() == DestTy) {
1297 Value *ZextC = Builder.CreateZExt(C, DestTy);
1309 Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
1320 Log2_64_Ceil(DestTy->getScalarSizeInBits()) &&
1479 Type *SrcTy = Src->getType(), *DestTy = Sext.getType();
1481 unsigned DestBitSize = DestTy->getScalarSizeInBits();
1485 auto CI = CastInst::Create(Instruction::ZExt, Src, DestTy);
1491 if (shouldChangeType(SrcTy, DestTy) && canEvaluateSExtd(Src, DestTy)) {
1497 Value *Res = EvaluateInDifferentType(Src, DestTy, true);
1498 assert(Res->getType() == DestTy);
1506 Value *ShAmt = ConstantInt::get(DestTy, DestBitSize-SrcBitSize);
1517 return CastInst::CreateIntegerCast(X, DestTy, /* isSigned */ true);
1520 if (Src->hasOneUse() && X->getType() == DestTy) {
1522 Constant *ShAmt = ConstantInt::get(DestTy, DestBitSize - SrcBitSize);
1535 return CastInst::CreateIntegerCast(Ashr, DestTy, /* isSigned */ true);
1560 BA->isElementWiseEqual(CA) && A->getType() == DestTy) {
1562 ConstantFoldCastOperand(Instruction::SExt, CA, DestTy, DL);
1565 ConstantInt::get(DestTy, SrcTy->getScalarSizeInBits()), WideCurrShAmt);
1567 ConstantInt::get(DestTy, DestTy->getScalarSizeInBits()),
1584 if (XTy == DestTy)
1589 return CastInst::CreateIntegerCast(Ashr, DestTy, /* isSigned */ true);
1600 Value *VScale = Builder.CreateVScale(ConstantInt::get(DestTy, 1));
2151 optimizeVectorResizeWithIntegerBitCasts(Value *InVal, VectorType *DestTy,
2158 if (SrcTy->getElementType() != DestTy->getElementType()) {
2164 DestTy->getElementType()->getPrimitiveSizeInBits())
2168 FixedVectorType::get(DestTy->getElementType(),
2175 unsigned DestElts = cast<FixedVectorType>(DestTy)->getNumElements();
2416 Type *DestTy = BitCast.getType();
2426 if (!DestTy->isVectorTy() || !BO->getType()->isVectorTy())
2429 if (DestTy->isFPOrFPVectorTy()) {
2439 return CastInst::CreateBitOrPointerCast(NewBO, DestTy);
2446 return CastInst::CreateBitOrPointerCast(NewBO, DestTy);
2452 if (!DestTy->isIntOrIntVectorTy())
2457 X->getType() == DestTy && !isa<Constant>(X)) {
2459 Value *CastedOp1 = Builder.CreateBitCast(BO->getOperand(1), DestTy);
2464 X->getType() == DestTy && !isa<Constant>(X)) {
2466 Value *CastedOp0 = Builder.CreateBitCast(BO->getOperand(0), DestTy);
2477 Value *CastedOp0 = Builder.CreateBitCast(BO->getOperand(0), DestTy);
2478 Value *CastedC = Builder.CreateBitCast(C, DestTy);
2495 Type *DestTy = BitCast.getType();
2497 if (!DestTy->isVectorTy() ||
2499 cast<VectorType>(DestTy)->getElementCount())
2506 if (DestTy->isVectorTy() != TVal->getType()->isVectorTy())
2511 if (match(TVal, m_OneUse(m_BitCast(m_Value(X)))) && X->getType() == DestTy &&
2514 Value *CastedVal = Builder.CreateBitCast(FVal, DestTy);
2518 if (match(FVal, m_OneUse(m_BitCast(m_Value(X)))) && X->getType() == DestTy &&
2521 Value *CastedVal = Builder.CreateBitCast(TVal, DestTy);
2553 Type *DestTy = CI.getType(); // Type A
2582 if (DestTy->isX86_AMXTy())
2605 if (TyA != DestTy || TyB != SrcTy)
2621 if (TyA != DestTy || TyB != SrcTy)
2639 PHINode *NewPN = Builder.CreatePHI(DestTy, OldPN->getNumOperands());
2650 NewV = ConstantExpr::getBitCast(C, DestTy);
2655 NewV = combineLoadToNewType(*LI, DestTy);
2695 assert(TyA == DestTy && TyB == SrcTy);
2739 Type *DestTy = CI.getType();
2743 if (DestTy == Src->getType())
2746 if (isa<FixedVectorType>(DestTy)) {
2756 BCIn->getOperand(0), cast<VectorType>(DestTy), *this))
2772 if (!DestTy->isVectorTy()) {
2776 return CastInst::Create(Instruction::BitCast, Elem, DestTy);
2783 return new BitCastInst(InsElt->getOperand(1), DestTy);
2787 unsigned BitWidth = DestTy->getScalarSizeInBits();
2792 DestTy->isIntegerTy() && X->getType() == DestTy &&
2805 Value *ZextY = Builder.CreateZExt(Y, DestTy);
2818 if (Shuf->hasOneUse() && DestTy->isVectorTy() &&
2819 cast<VectorType>(DestTy)->getElementCount() == ShufElts &&
2826 Tmp->getOperand(0)->getType() == DestTy) ||
2828 Tmp->getOperand(0)->getType() == DestTy)) {
2829 Value *LHS = Builder.CreateBitCast(ShufOp0, DestTy);
2830 Value *RHS = Builder.CreateBitCast(ShufOp1, DestTy);
2841 if (DestTy->isIntegerTy() && ShufElts.getKnownMinValue() % 2 == 0 &&
2844 if (DL.isLegalInteger(DestTy->getScalarSizeInBits()) &&
2854 CI.getModule(), IntrinsicNum, DestTy);
2855 Value *ScalarX = Builder.CreateBitCast(ShufOp0, DestTy);