Home | History | Annotate | Download | only in Scalar

Lines Matching refs:SrcVal

998 static Value *GetStoreValueForLoad(Value *SrcVal, unsigned Offset,
1001 LLVMContext &Ctx = SrcVal->getType()->getContext();
1003 uint64_t StoreSize = (TD.getTypeSizeInBits(SrcVal->getType()) + 7) / 8;
1010 if (SrcVal->getType()->isPointerTy())
1011 SrcVal = Builder.CreatePtrToInt(SrcVal, TD.getIntPtrType(Ctx));
1012 if (!SrcVal->getType()->isIntegerTy())
1013 SrcVal = Builder.CreateBitCast(SrcVal, IntegerType::get(Ctx, StoreSize*8));
1023 SrcVal = Builder.CreateLShr(SrcVal, ShiftAmt);
1026 SrcVal = Builder.CreateTrunc(SrcVal, IntegerType::get(Ctx, LoadSize*8));
1028 return CoerceAvailableValueToLoadType(SrcVal, LoadTy, InsertPt, TD);
1036 static Value *GetLoadValueForLoad(LoadInst *SrcVal, unsigned Offset,
1040 // If Offset+LoadTy exceeds the size of SrcVal, then we must be wanting to
1041 // widen SrcVal out to a larger load.
1042 unsigned SrcValSize = TD.getTypeStoreSize(SrcVal->getType());
1045 assert(SrcVal->isSimple() && "Cannot widen volatile/atomic load!");
1046 assert(SrcVal->getType()->isIntegerTy() && "Can't widen non-integer load");
1053 Value *PtrVal = SrcVal->getPointerOperand();
1058 IRBuilder<> Builder(SrcVal->getParent(), ++BasicBlock::iterator(SrcVal));
1063 Builder.SetCurrentDebugLocation(SrcVal->getDebugLoc());
1066 NewLoad->takeName(SrcVal);
1067 NewLoad->setAlignment(SrcVal->getAlignment());
1069 DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n");
1077 NewLoadSize*8-SrcVal->getType()->getPrimitiveSizeInBits());
1078 RV = Builder.CreateTrunc(RV, SrcVal->getType());
1079 SrcVal->replaceAllUsesWith(RV);
1086 gvn.getMemDep().removeInstruction(SrcVal);
1087 SrcVal = NewLoad;
1090 return GetStoreValueForLoad(SrcVal, Offset, LoadTy, InsertPt, TD);