Home | History | Annotate | Download | only in Scalar

Lines Matching full:srcval

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