Lines Matching defs:SrcVal
297 static Value *getStoreValueForLoadHelper(Value *SrcVal, unsigned Offset,
300 LLVMContext &Ctx = SrcVal->getType()->getContext();
305 if (SrcVal->getType()->isPointerTy() && LoadTy->isPointerTy() &&
306 cast<PointerType>(SrcVal->getType())->getAddressSpace() ==
308 return SrcVal;
315 return SrcVal;
319 (DL.getTypeSizeInBits(SrcVal->getType()).getFixedValue() + 7) / 8;
323 if (SrcVal->getType()->isPtrOrPtrVectorTy())
324 SrcVal =
325 Builder.CreatePtrToInt(SrcVal, DL.getIntPtrType(SrcVal->getType()));
326 if (!SrcVal->getType()->isIntegerTy())
327 SrcVal =
328 Builder.CreateBitCast(SrcVal, IntegerType::get(Ctx, StoreSize * 8));
337 SrcVal = Builder.CreateLShr(SrcVal,
338 ConstantInt::get(SrcVal->getType(), ShiftAmt));
341 SrcVal = Builder.CreateTruncOrBitCast(SrcVal,
343 return SrcVal;
346 Value *getValueForLoad(Value *SrcVal, unsigned Offset, Type *LoadTy,
349 TypeSize SrcValSize = DL.getTypeStoreSize(SrcVal->getType());
359 SrcVal = getStoreValueForLoadHelper(SrcVal, Offset, LoadTy, Builder, DL);
360 return coerceAvailableValueToLoadType(SrcVal, LoadTy, Builder, DL);
363 Constant *getConstantValueForLoad(Constant *SrcVal, unsigned Offset,
366 unsigned SrcValSize = DL.getTypeStoreSize(SrcVal->getType()).getFixedValue();
370 return ConstantFoldLoadFromConst(SrcVal, LoadTy, APInt(32, Offset), DL);