Lines Matching refs:SrcVal
1131 static Value *GetStoreValueForLoad(Value *SrcVal, unsigned Offset, in GetStoreValueForLoad() argument
1134 LLVMContext &Ctx = SrcVal->getType()->getContext(); in GetStoreValueForLoad()
1136 uint64_t StoreSize = (DL.getTypeSizeInBits(SrcVal->getType()) + 7) / 8; in GetStoreValueForLoad()
1143 if (SrcVal->getType()->getScalarType()->isPointerTy()) in GetStoreValueForLoad()
1144 SrcVal = Builder.CreatePtrToInt(SrcVal, in GetStoreValueForLoad()
1145 DL.getIntPtrType(SrcVal->getType())); in GetStoreValueForLoad()
1146 if (!SrcVal->getType()->isIntegerTy()) in GetStoreValueForLoad()
1147 SrcVal = Builder.CreateBitCast(SrcVal, IntegerType::get(Ctx, StoreSize*8)); in GetStoreValueForLoad()
1157 SrcVal = Builder.CreateLShr(SrcVal, ShiftAmt); in GetStoreValueForLoad()
1160 SrcVal = Builder.CreateTrunc(SrcVal, IntegerType::get(Ctx, LoadSize*8)); in GetStoreValueForLoad()
1162 return CoerceAvailableValueToLoadType(SrcVal, LoadTy, Builder, DL); in GetStoreValueForLoad()
1170 static Value *GetLoadValueForLoad(LoadInst *SrcVal, unsigned Offset, in GetLoadValueForLoad() argument
1173 const DataLayout &DL = SrcVal->getModule()->getDataLayout(); in GetLoadValueForLoad()
1176 unsigned SrcValSize = DL.getTypeStoreSize(SrcVal->getType()); in GetLoadValueForLoad()
1179 assert(SrcVal->isSimple() && "Cannot widen volatile/atomic load!"); in GetLoadValueForLoad()
1180 assert(SrcVal->getType()->isIntegerTy() && "Can't widen non-integer load"); in GetLoadValueForLoad()
1187 Value *PtrVal = SrcVal->getPointerOperand(); in GetLoadValueForLoad()
1192 IRBuilder<> Builder(SrcVal->getParent(), ++BasicBlock::iterator(SrcVal)); in GetLoadValueForLoad()
1197 Builder.SetCurrentDebugLocation(SrcVal->getDebugLoc()); in GetLoadValueForLoad()
1200 NewLoad->takeName(SrcVal); in GetLoadValueForLoad()
1201 NewLoad->setAlignment(SrcVal->getAlignment()); in GetLoadValueForLoad()
1203 DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n"); in GetLoadValueForLoad()
1211 NewLoadSize*8-SrcVal->getType()->getPrimitiveSizeInBits()); in GetLoadValueForLoad()
1212 RV = Builder.CreateTrunc(RV, SrcVal->getType()); in GetLoadValueForLoad()
1213 SrcVal->replaceAllUsesWith(RV); in GetLoadValueForLoad()
1220 gvn.getMemDep().removeInstruction(SrcVal); in GetLoadValueForLoad()
1221 SrcVal = NewLoad; in GetLoadValueForLoad()
1224 return GetStoreValueForLoad(SrcVal, Offset, LoadTy, InsertPt, DL); in GetLoadValueForLoad()