Lines Matching defs:DestTy

71 static Constant *foldConstVectorToAPInt(APInt &Result, Type *DestTy,
92 return ConstantExpr::getBitCast(C, DestTy);
104 Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
105 assert(CastInst::castIsValid(Instruction::BitCast, C, DestTy) &&
109 if (Constant *Res = ConstantFoldLoadFromUniformValue(C, DestTy, DL))
114 if (isa<IntegerType>(DestTy) || DestTy->isFloatingPointTy()) {
128 APInt Result(DL.getTypeSizeInBits(DestTy), 0);
129 if (Constant *CE = foldConstVectorToAPInt(Result, DestTy, C,
133 if (isa<IntegerType>(DestTy))
134 return ConstantInt::get(DestTy, Result);
136 APFloat FP(DestTy->getFltSemantics(), Result);
137 return ConstantFP::get(DestTy->getContext(), FP);
142 auto *DestVTy = dyn_cast<VectorType>(DestTy);
144 return ConstantExpr::getBitCast(C, DestTy);
150 return FoldBitCast(ConstantVector::get(Ops), DestTy, DL);
155 return ConstantExpr::getBitCast(C, DestTy);
161 return ConstantExpr::getBitCast(C, DestTy);
185 return ConstantExpr::getBitCast(C, DestTy);
227 return ConstantExpr::getBitCast(C, DestTy);
260 return ConstantExpr::getBitCast(C, DestTy);
270 return ConstantExpr::getBitCast(C, DestTy);
344 Constant *llvm::ConstantFoldLoadThroughBitcast(Constant *C, Type *DestTy,
348 if (SrcTy == DestTy)
351 TypeSize DestSize = DL.getTypeSizeInBits(DestTy);
358 if (Constant *Res = ConstantFoldLoadFromUniformValue(C, DestTy, DL))
366 DL.isNonIntegralPointerType(DestTy->getScalarType())) {
370 if (SrcTy->isIntegerTy() && DestTy->isPointerTy())
372 else if (SrcTy->isPointerTy() && DestTy->isIntegerTy())
375 if (CastInst::castIsValid(Cast, C, DestTy))
376 return ConstantFoldCastOperand(Cast, C, DestTy, DL);
980 Type *DestTy = InstOrCE->getType();
1006 return ConstantFoldCastOperand(Opcode, Ops[0], DestTy, DL);
1387 Type *DestTy, const DataLayout &DL) {
1429 return ConstantFoldIntegerCast(FoldedValue, DestTy, /*IsSigned=*/false,
1447 if (SrcAS == DestTy->getPointerAddressSpace())
1448 return FoldBitCast(CE->getOperand(0), DestTy, DL);
1465 return FoldBitCast(C, DestTy, DL);
1469 return ConstantExpr::getCast(Opcode, C, DestTy);
1470 return ConstantFoldCastInstruction(Opcode, C, DestTy);
1473 Constant *llvm::ConstantFoldIntegerCast(Constant *C, Type *DestTy,
1476 if (SrcTy == DestTy)
1478 if (SrcTy->getScalarSizeInBits() > DestTy->getScalarSizeInBits())
1479 return ConstantFoldCastOperand(Instruction::Trunc, C, DestTy, DL);
1481 return ConstantFoldCastOperand(Instruction::SExt, C, DestTy, DL);
1482 return ConstantFoldCastOperand(Instruction::ZExt, C, DestTy, DL);