Lines Matching defs:DestTy

73 static Constant *foldConstVectorToAPInt(APInt &Result, Type *DestTy,
94 return ConstantExpr::getBitCast(C, DestTy);
106 Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) {
107 assert(CastInst::castIsValid(Instruction::BitCast, C, DestTy) &&
111 if (Constant *Res = ConstantFoldLoadFromUniformValue(C, DestTy, DL))
116 if (isa<IntegerType>(DestTy) || DestTy->isFloatingPointTy()) {
130 APInt Result(DL.getTypeSizeInBits(DestTy), 0);
131 if (Constant *CE = foldConstVectorToAPInt(Result, DestTy, C,
135 if (isa<IntegerType>(DestTy))
136 return ConstantInt::get(DestTy, Result);
138 APFloat FP(DestTy->getFltSemantics(), Result);
139 return ConstantFP::get(DestTy->getContext(), FP);
144 auto *DestVTy = dyn_cast<VectorType>(DestTy);
146 return ConstantExpr::getBitCast(C, DestTy);
153 return FoldBitCast(ConstantVector::get(Ops), DestTy, DL);
159 return ConstantExpr::getBitCast(C, DestTy);
164 return ConstantExpr::getBitCast(C, DestTy);
170 return ConstantExpr::getBitCast(C, DestTy);
194 return ConstantExpr::getBitCast(C, DestTy);
235 return ConstantExpr::getBitCast(C, DestTy);
268 return ConstantExpr::getBitCast(C, DestTy);
278 return ConstantExpr::getBitCast(C, DestTy);
352 Constant *llvm::ConstantFoldLoadThroughBitcast(Constant *C, Type *DestTy,
356 if (SrcTy == DestTy)
359 TypeSize DestSize = DL.getTypeSizeInBits(DestTy);
366 if (Constant *Res = ConstantFoldLoadFromUniformValue(C, DestTy, DL))
374 DL.isNonIntegralPointerType(DestTy->getScalarType())) {
378 if (SrcTy->isIntegerTy() && DestTy->isPointerTy())
380 else if (SrcTy->isPointerTy() && DestTy->isIntegerTy())
383 if (CastInst::castIsValid(Cast, C, DestTy))
384 return ConstantFoldCastOperand(Cast, C, DestTy, DL);
991 Type *DestTy = InstOrCE->getType();
1017 return ConstantFoldCastOperand(Opcode, Ops[0], DestTy, DL);
1463 Type *DestTy, const DataLayout &DL) {
1505 return ConstantFoldIntegerCast(FoldedValue, DestTy, /*IsSigned=*/false,
1523 if (SrcAS == DestTy->getPointerAddressSpace())
1524 return FoldBitCast(CE->getOperand(0), DestTy, DL);
1541 return FoldBitCast(C, DestTy, DL);
1545 return ConstantExpr::getCast(Opcode, C, DestTy);
1546 return ConstantFoldCastInstruction(Opcode, C, DestTy);
1549 Constant *llvm::ConstantFoldIntegerCast(Constant *C, Type *DestTy,
1552 if (SrcTy == DestTy)
1554 if (SrcTy->getScalarSizeInBits() > DestTy->getScalarSizeInBits())
1555 return ConstantFoldCastOperand(Instruction::Trunc, C, DestTy, DL);
1557 return ConstantFoldCastOperand(Instruction::SExt, C, DestTy, DL);
1558 return ConstantFoldCastOperand(Instruction::ZExt, C, DestTy, DL);