Lines Matching defs:SrcVal

1111 static Value *GetStoreValueForLoad(Value *SrcVal, unsigned Offset,
1114 LLVMContext &Ctx = SrcVal->getType()->getContext();
1116 uint64_t StoreSize = (TD.getTypeSizeInBits(SrcVal->getType()) + 7) / 8;
1123 if (SrcVal->getType()->getScalarType()->isPointerTy())
1124 SrcVal = Builder.CreatePtrToInt(SrcVal,
1125 TD.getIntPtrType(SrcVal->getType()));
1126 if (!SrcVal->getType()->isIntegerTy())
1127 SrcVal = Builder.CreateBitCast(SrcVal, IntegerType::get(Ctx, StoreSize*8));
1137 SrcVal = Builder.CreateLShr(SrcVal, ShiftAmt);
1140 SrcVal = Builder.CreateTrunc(SrcVal, IntegerType::get(Ctx, LoadSize*8));
1142 return CoerceAvailableValueToLoadType(SrcVal, LoadTy, InsertPt, TD);
1150 static Value *GetLoadValueForLoad(LoadInst *SrcVal, unsigned Offset,
1154 // If Offset+LoadTy exceeds the size of SrcVal, then we must be wanting to
1155 // widen SrcVal out to a larger load.
1156 unsigned SrcValSize = TD.getTypeStoreSize(SrcVal->getType());
1159 assert(SrcVal->isSimple() && "Cannot widen volatile/atomic load!");
1160 assert(SrcVal->getType()->isIntegerTy() && "Can't widen non-integer load");
1167 Value *PtrVal = SrcVal->getPointerOperand();
1172 IRBuilder<> Builder(SrcVal->getParent(), ++BasicBlock::iterator(SrcVal));
1177 Builder.SetCurrentDebugLocation(SrcVal->getDebugLoc());
1180 NewLoad->takeName(SrcVal);
1181 NewLoad->setAlignment(SrcVal->getAlignment());
1183 DEBUG(dbgs() << "GVN WIDENED LOAD: " << *SrcVal << "\n");
1191 NewLoadSize*8-SrcVal->getType()->getPrimitiveSizeInBits());
1192 RV = Builder.CreateTrunc(RV, SrcVal->getType());
1193 SrcVal->replaceAllUsesWith(RV);
1200 gvn.getMemDep().removeInstruction(SrcVal);
1201 SrcVal = NewLoad;
1204 return GetStoreValueForLoad(SrcVal, Offset, LoadTy, InsertPt, TD);