Lines Matching refs:DestTy
95 static Constant *FoldBitCast(Constant *V, Type *DestTy) { in FoldBitCast() argument
97 if (SrcTy == DestTy) in FoldBitCast()
103 if (PointerType *DPTy = dyn_cast<PointerType>(DestTy)) in FoldBitCast()
133 if (VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) { in FoldBitCast()
140 return Constant::getNullValue(DestTy); in FoldBitCast()
156 return ConstantPointerNull::get(cast<PointerType>(DestTy)); in FoldBitCast()
160 if (DestTy->isIntegerTy()) in FoldBitCast()
165 if (DestTy->isFloatingPointTy()) in FoldBitCast()
166 return ConstantFP::get(DestTy->getContext(), in FoldBitCast()
168 !DestTy->isPPC_FP128Ty())); in FoldBitCast()
332 static Constant *getFoldedSizeOf(Type *Ty, Type *DestTy, in getFoldedSizeOf() argument
335 Constant *N = ConstantInt::get(DestTy, ATy->getNumElements()); in getFoldedSizeOf()
336 Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true); in getFoldedSizeOf()
345 return ConstantExpr::getNullValue(DestTy); in getFoldedSizeOf()
348 getFoldedSizeOf(STy->getElementType(0), DestTy, true); in getFoldedSizeOf()
352 getFoldedSizeOf(STy->getElementType(i), DestTy, true)) { in getFoldedSizeOf()
357 Constant *N = ConstantInt::get(DestTy, NumElems); in getFoldedSizeOf()
369 DestTy, true); in getFoldedSizeOf()
379 DestTy, false), in getFoldedSizeOf()
380 C, DestTy); in getFoldedSizeOf()
389 static Constant *getFoldedAlignOf(Type *Ty, Type *DestTy, in getFoldedAlignOf() argument
396 DestTy, in getFoldedAlignOf()
398 C, DestTy); in getFoldedAlignOf()
405 return ConstantInt::get(DestTy, 1); in getFoldedAlignOf()
413 return ConstantInt::get(DestTy, 1); in getFoldedAlignOf()
416 getFoldedAlignOf(STy->getElementType(0), DestTy, true); in getFoldedAlignOf()
419 if (MemberAlign != getFoldedAlignOf(STy->getElementType(i), DestTy, true)) { in getFoldedAlignOf()
435 DestTy, true); in getFoldedAlignOf()
445 DestTy, false), in getFoldedAlignOf()
446 C, DestTy); in getFoldedAlignOf()
456 Type *DestTy, in getFoldedOffsetOf() argument
460 DestTy, false), in getFoldedOffsetOf()
461 FieldNo, DestTy); in getFoldedOffsetOf()
462 Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true); in getFoldedOffsetOf()
474 getFoldedSizeOf(STy->getElementType(0), DestTy, true); in getFoldedOffsetOf()
478 getFoldedSizeOf(STy->getElementType(i), DestTy, true)) { in getFoldedOffsetOf()
485 DestTy, in getFoldedOffsetOf()
487 FieldNo, DestTy); in getFoldedOffsetOf()
500 DestTy, false), in getFoldedOffsetOf()
501 C, DestTy); in getFoldedOffsetOf()
506 Type *DestTy) { in ConstantFoldCastInstruction() argument
513 return Constant::getNullValue(DestTy); in ConstantFoldCastInstruction()
514 return UndefValue::get(DestTy); in ConstantFoldCastInstruction()
518 if (V->getType()->isPPC_FP128Ty() || DestTy->isPPC_FP128Ty()) in ConstantFoldCastInstruction()
521 if (V->isNullValue() && !DestTy->isX86_MMXTy()) in ConstantFoldCastInstruction()
522 return Constant::getNullValue(DestTy); in ConstantFoldCastInstruction()
529 if (unsigned newOpc = foldConstantCastPair(opc, CE, DestTy)) in ConstantFoldCastInstruction()
530 return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
542 return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy); in ConstantFoldCastInstruction()
550 DestTy->isVectorTy() && in ConstantFoldCastInstruction()
551 DestTy->getVectorNumElements() == V->getType()->getVectorNumElements()) { in ConstantFoldCastInstruction()
553 VectorType *DestVecTy = cast<VectorType>(DestTy); in ConstantFoldCastInstruction()
574 Val.convert(DestTy->isHalfTy() ? APFloat::IEEEhalf : in ConstantFoldCastInstruction()
575 DestTy->isFloatTy() ? APFloat::IEEEsingle : in ConstantFoldCastInstruction()
576 DestTy->isDoubleTy() ? APFloat::IEEEdouble : in ConstantFoldCastInstruction()
577 DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended : in ConstantFoldCastInstruction()
578 DestTy->isFP128Ty() ? APFloat::IEEEquad : in ConstantFoldCastInstruction()
590 uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth(); in ConstantFoldCastInstruction()
599 return ConstantPointerNull::get(cast<PointerType>(DestTy)); in ConstantFoldCastInstruction()
604 return ConstantInt::get(DestTy, 0); in ConstantFoldCastInstruction()
617 if (Constant *C = getFoldedSizeOf(Ty, DestTy, !isOne)) { in ConstantFoldCastInstruction()
619 DestTy, false), in ConstantFoldCastInstruction()
620 Idx, DestTy); in ConstantFoldCastInstruction()
632 return getFoldedAlignOf(STy->getElementType(1), DestTy, false); in ConstantFoldCastInstruction()
638 DestTy, false)) in ConstantFoldCastInstruction()
649 APFloat apf(APInt::getNullValue(DestTy->getPrimitiveSizeInBits()), true); in ConstantFoldCastInstruction()
658 uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth(); in ConstantFoldCastInstruction()
665 uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth(); in ConstantFoldCastInstruction()
671 uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth(); in ConstantFoldCastInstruction()
688 return FoldBitCast(V, DestTy); in ConstantFoldCastInstruction()