Lines Matching refs:DestTy

71 static Constant *foldConstVectorToAPInt(APInt &Result, Type *DestTy,  in foldConstVectorToAPInt()  argument
92 return ConstantExpr::getBitCast(C, DestTy); in foldConstVectorToAPInt()
104 Constant *FoldBitCast(Constant *C, Type *DestTy, const DataLayout &DL) { in FoldBitCast() argument
105 assert(CastInst::castIsValid(Instruction::BitCast, C, DestTy) && in FoldBitCast()
109 if (Constant *Res = ConstantFoldLoadFromUniformValue(C, DestTy)) in FoldBitCast()
114 if (isa<IntegerType>(DestTy) || DestTy->isFloatingPointTy()) { in FoldBitCast()
128 APInt Result(DL.getTypeSizeInBits(DestTy), 0); in FoldBitCast()
129 if (Constant *CE = foldConstVectorToAPInt(Result, DestTy, C, in FoldBitCast()
133 if (isa<IntegerType>(DestTy)) in FoldBitCast()
134 return ConstantInt::get(DestTy, Result); in FoldBitCast()
136 APFloat FP(DestTy->getFltSemantics(), Result); in FoldBitCast()
137 return ConstantFP::get(DestTy->getContext(), FP); in FoldBitCast()
142 auto *DestVTy = dyn_cast<VectorType>(DestTy); in FoldBitCast()
144 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
150 return FoldBitCast(ConstantVector::get(Ops), DestTy, DL); in FoldBitCast()
155 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
161 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
185 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
227 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
254 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
264 return ConstantExpr::getBitCast(C, DestTy); in FoldBitCast()
348 Constant *llvm::ConstantFoldLoadThroughBitcast(Constant *C, Type *DestTy, in ConstantFoldLoadThroughBitcast() argument
352 if (SrcTy == DestTy) in ConstantFoldLoadThroughBitcast()
355 TypeSize DestSize = DL.getTypeSizeInBits(DestTy); in ConstantFoldLoadThroughBitcast()
362 if (Constant *Res = ConstantFoldLoadFromUniformValue(C, DestTy)) in ConstantFoldLoadThroughBitcast()
370 DL.isNonIntegralPointerType(DestTy->getScalarType())) { in ConstantFoldLoadThroughBitcast()
374 if (SrcTy->isIntegerTy() && DestTy->isPointerTy()) in ConstantFoldLoadThroughBitcast()
376 else if (SrcTy->isPointerTy() && DestTy->isIntegerTy()) in ConstantFoldLoadThroughBitcast()
379 if (CastInst::castIsValid(Cast, C, DestTy)) in ConstantFoldLoadThroughBitcast()
380 return ConstantExpr::getCast(Cast, C, DestTy); in ConstantFoldLoadThroughBitcast()
1029 Type *DestTy = InstOrCE->getType(); in ConstantFoldInstOperandsImpl() local
1054 return ConstantFoldCastOperand(Opcode, Ops[0], DestTy, DL); in ConstantFoldInstOperandsImpl()
1412 Type *DestTy, const DataLayout &DL) { in ConstantFoldCastOperand() argument
1454 return ConstantExpr::getIntegerCast(FoldedValue, DestTy, in ConstantFoldCastOperand()
1458 return ConstantExpr::getCast(Opcode, C, DestTy); in ConstantFoldCastOperand()
1472 if (SrcAS == DestTy->getPointerAddressSpace()) in ConstantFoldCastOperand()
1473 return FoldBitCast(CE->getOperand(0), DestTy, DL); in ConstantFoldCastOperand()
1478 return ConstantExpr::getCast(Opcode, C, DestTy); in ConstantFoldCastOperand()
1489 return ConstantExpr::getCast(Opcode, C, DestTy); in ConstantFoldCastOperand()
1491 return FoldBitCast(C, DestTy, DL); in ConstantFoldCastOperand()