Lines Matching refs:DestTy
100 static Constant *FoldBitCast(Constant *V, Type *DestTy) { in FoldBitCast() argument
102 if (SrcTy == DestTy) in FoldBitCast()
108 if (PointerType *DPTy = dyn_cast<PointerType>(DestTy)) in FoldBitCast()
139 if (VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) { in FoldBitCast()
146 return Constant::getNullValue(DestTy); in FoldBitCast()
162 return ConstantPointerNull::get(cast<PointerType>(DestTy)); in FoldBitCast()
166 if (DestTy->isIntegerTy()) in FoldBitCast()
172 if (DestTy->isFloatingPointTy() && !DestTy->isPPC_FP128Ty()) in FoldBitCast()
173 return ConstantFP::get(DestTy->getContext(), in FoldBitCast()
174 APFloat(DestTy->getFltSemantics(), in FoldBitCast()
193 if (!DestTy->isIntegerTy()) in FoldBitCast()
351 static Constant *getFoldedSizeOf(Type *Ty, Type *DestTy, in getFoldedSizeOf() argument
354 Constant *N = ConstantInt::get(DestTy, ATy->getNumElements()); in getFoldedSizeOf()
355 Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true); in getFoldedSizeOf()
364 return ConstantExpr::getNullValue(DestTy); in getFoldedSizeOf()
367 getFoldedSizeOf(STy->getElementType(0), DestTy, true); in getFoldedSizeOf()
371 getFoldedSizeOf(STy->getElementType(i), DestTy, true)) { in getFoldedSizeOf()
376 Constant *N = ConstantInt::get(DestTy, NumElems); in getFoldedSizeOf()
388 DestTy, true); in getFoldedSizeOf()
398 DestTy, false), in getFoldedSizeOf()
399 C, DestTy); in getFoldedSizeOf()
407 static Constant *getFoldedAlignOf(Type *Ty, Type *DestTy, in getFoldedAlignOf() argument
414 DestTy, in getFoldedAlignOf()
416 C, DestTy); in getFoldedAlignOf()
423 return ConstantInt::get(DestTy, 1); in getFoldedAlignOf()
431 return ConstantInt::get(DestTy, 1); in getFoldedAlignOf()
434 getFoldedAlignOf(STy->getElementType(0), DestTy, true); in getFoldedAlignOf()
437 if (MemberAlign != getFoldedAlignOf(STy->getElementType(i), DestTy, true)) { in getFoldedAlignOf()
453 DestTy, true); in getFoldedAlignOf()
463 DestTy, false), in getFoldedAlignOf()
464 C, DestTy); in getFoldedAlignOf()
473 Type *DestTy, in getFoldedOffsetOf() argument
477 DestTy, false), in getFoldedOffsetOf()
478 FieldNo, DestTy); in getFoldedOffsetOf()
479 Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true); in getFoldedOffsetOf()
491 getFoldedSizeOf(STy->getElementType(0), DestTy, true); in getFoldedOffsetOf()
495 getFoldedSizeOf(STy->getElementType(i), DestTy, true)) { in getFoldedOffsetOf()
502 DestTy, in getFoldedOffsetOf()
504 FieldNo, DestTy); in getFoldedOffsetOf()
517 DestTy, false), in getFoldedOffsetOf()
518 C, DestTy); in getFoldedOffsetOf()
523 Type *DestTy) { in ConstantFoldCastInstruction() argument
530 return Constant::getNullValue(DestTy); in ConstantFoldCastInstruction()
531 return UndefValue::get(DestTy); in ConstantFoldCastInstruction()
534 if (V->isNullValue() && !DestTy->isX86_MMXTy() && in ConstantFoldCastInstruction()
536 return Constant::getNullValue(DestTy); in ConstantFoldCastInstruction()
543 if (unsigned newOpc = foldConstantCastPair(opc, CE, DestTy)) in ConstantFoldCastInstruction()
544 return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
559 return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
567 DestTy->isVectorTy() && in ConstantFoldCastInstruction()
568 DestTy->getVectorNumElements() == V->getType()->getVectorNumElements()) { in ConstantFoldCastInstruction()
570 VectorType *DestVecTy = cast<VectorType>(DestTy); in ConstantFoldCastInstruction()
591 Val.convert(DestTy->isHalfTy() ? APFloat::IEEEhalf : in ConstantFoldCastInstruction()
592 DestTy->isFloatTy() ? APFloat::IEEEsingle : in ConstantFoldCastInstruction()
593 DestTy->isDoubleTy() ? APFloat::IEEEdouble : in ConstantFoldCastInstruction()
594 DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended : in ConstantFoldCastInstruction()
595 DestTy->isFP128Ty() ? APFloat::IEEEquad : in ConstantFoldCastInstruction()
596 DestTy->isPPC_FP128Ty() ? APFloat::PPCDoubleDouble : in ConstantFoldCastInstruction()
608 uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth(); in ConstantFoldCastInstruction()
614 return UndefValue::get(DestTy); in ConstantFoldCastInstruction()
622 return ConstantPointerNull::get(cast<PointerType>(DestTy)); in ConstantFoldCastInstruction()
627 return ConstantInt::get(DestTy, 0); in ConstantFoldCastInstruction()
640 if (Constant *C = getFoldedSizeOf(Ty, DestTy, !isOne)) { in ConstantFoldCastInstruction()
642 DestTy, false), in ConstantFoldCastInstruction()
643 Idx, DestTy); in ConstantFoldCastInstruction()
655 return getFoldedAlignOf(STy->getElementType(1), DestTy, false); in ConstantFoldCastInstruction()
661 DestTy, false)) in ConstantFoldCastInstruction()
672 APFloat apf(DestTy->getFltSemantics(), in ConstantFoldCastInstruction()
673 APInt::getNullValue(DestTy->getPrimitiveSizeInBits())); in ConstantFoldCastInstruction()
679 return UndefValue::get(DestTy); in ConstantFoldCastInstruction()
686 uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth(); in ConstantFoldCastInstruction()
693 uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth(); in ConstantFoldCastInstruction()
702 uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth(); in ConstantFoldCastInstruction()
719 return FoldBitCast(V, DestTy); in ConstantFoldCastInstruction()