Lines Matching refs:SrcVal
986 static Value *GetStoreValueForLoad(Value *SrcVal, unsigned Offset, in GetStoreValueForLoad() argument
989 LLVMContext &Ctx = SrcVal->getType()->getContext(); in GetStoreValueForLoad()
991 uint64_t StoreSize = (DL.getTypeSizeInBits(SrcVal->getType()) + 7) / 8; in GetStoreValueForLoad()
998 if (SrcVal->getType()->getScalarType()->isPointerTy()) in GetStoreValueForLoad()
999 SrcVal = Builder.CreatePtrToInt(SrcVal, in GetStoreValueForLoad()
1000 DL.getIntPtrType(SrcVal->getType())); in GetStoreValueForLoad()
1001 if (!SrcVal->getType()->isIntegerTy()) in GetStoreValueForLoad()
1002 SrcVal = Builder.CreateBitCast(SrcVal, IntegerType::get(Ctx, StoreSize*8)); in GetStoreValueForLoad()
1012 SrcVal = Builder.CreateLShr(SrcVal, ShiftAmt); in GetStoreValueForLoad()
1015 SrcVal = Builder.CreateTrunc(SrcVal, IntegerType::get(Ctx, LoadSize*8)); in GetStoreValueForLoad()
1017 return CoerceAvailableValueToLoadType(SrcVal, LoadTy, Builder, DL); in GetStoreValueForLoad()
1025 static Value *GetLoadValueForLoad(LoadInst *SrcVal, unsigned Offset, in GetLoadValueForLoad() argument
1028 const DataLayout &DL = SrcVal->getModule()->getDataLayout(); in GetLoadValueForLoad()
1031 unsigned SrcValStoreSize = DL.getTypeStoreSize(SrcVal->getType()); in GetLoadValueForLoad()
1034 assert(SrcVal->isSimple() && "Cannot widen volatile/atomic load!"); in GetLoadValueForLoad()
1035 assert(SrcVal->getType()->isIntegerTy() && "Can't widen non-integer load"); in GetLoadValueForLoad()
1042 Value *PtrVal = SrcVal->getPointerOperand(); in GetLoadValueForLoad()
1047 IRBuilder<> Builder(SrcVal->getParent(), ++BasicBlock::iterator(SrcVal)); in GetLoadValueForLoad()
1052 Builder.SetCurrentDebugLocation(SrcVal->getDebugLoc()); in GetLoadValueForLoad()
1055 NewLoad->takeName(SrcVal); in GetLoadValueForLoad()
1056 NewLoad->setAlignment(SrcVal->getAlignment()); in GetLoadValueForLoad()
1058 DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n"); in GetLoadValueForLoad()
1066 RV = Builder.CreateTrunc(RV, SrcVal->getType()); in GetLoadValueForLoad()
1067 SrcVal->replaceAllUsesWith(RV); in GetLoadValueForLoad()
1074 gvn.getMemDep().removeInstruction(SrcVal); in GetLoadValueForLoad()
1075 SrcVal = NewLoad; in GetLoadValueForLoad()
1078 return GetStoreValueForLoad(SrcVal, Offset, LoadTy, InsertPt, DL); in GetLoadValueForLoad()