Lines Matching defs:GEP

85   // Decompose a ptr into Base and Offsets, potentially using a GEP to return a
95 GetElementPtrInst *GEP, IRBuilder<> &Builder);
147 Value *foldGEP(GetElementPtrInst *GEP, Value *&Offsets, unsigned &Scale,
230 if (auto *GEP = dyn_cast<GetElementPtrInst>(Ptr)) {
231 if (Value *V = decomposeGEP(Offsets, Ty, GEP, Builder)) {
233 computeScale(GEP->getSourceElementType()->getPrimitiveSizeInBits(),
239 // If we couldn't use the GEP (or it doesn't exist), attempt to use a
255 GetElementPtrInst *GEP,
257 if (!GEP) {
264 Value *GEPPtr = GEP->getPointerOperand();
265 Offsets = GEP->getOperand(1);
270 if (GEP->getNumOperands() != 2) {
275 Offsets = GEP->getOperand(1);
742 // Decompose the GEP into Base and Offsets
743 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr);
745 Value *BasePtr = decomposeGEP(Offsets, Ty, GEP, Builder);
755 computeScale(DL->getTypeSizeInBits(GEP->getSourceElementType()),
756 DL->getTypeSizeInBits(GEP->getType()) /
757 cast<FixedVectorType>(GEP->getType())->getNumElements());
761 if (GEP->hasOneUse()) {
1187 Value *MVEGatherScatterLowering::foldGEP(GetElementPtrInst *GEP,
1190 Value *GEPPtr = GEP->getPointerOperand();
1191 Offsets = GEP->getOperand(1);
1192 Scale = DL->getTypeAllocSize(GEP->getSourceElementType());
1195 if (GEP->getNumIndices() != 1 || !isa<Constant>(Offsets))
1203 Offsets, Scale, GEP->getOperand(1),
1204 DL->getTypeAllocSize(GEP->getSourceElementType()), Builder);
1215 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Address);
1216 if (!GEP)
1219 if (GEP->hasOneUse() && isa<GetElementPtrInst>(GEP->getPointerOperand())) {
1220 IRBuilder<> Builder(GEP->getContext());
1221 Builder.SetInsertPoint(GEP);
1222 Builder.SetCurrentDebugLocation(GEP->getDebugLoc());
1225 Value *Base = foldGEP(GEP, Offsets, Scale, Builder);
1230 if (Offsets && Base && Base != GEP) {
1231 assert(Scale == 1 && "Expected to fold GEP to a scale of 1");
1237 "gep.merged", GEP->getIterator());
1238 LLVM_DEBUG(dbgs() << "Folded GEP: " << *GEP
1240 GEP->replaceAllUsesWith(
1241 Builder.CreateBitCast(NewAddress, GEP->getType()));
1242 GEP = NewAddress;
1246 Changed |= optimiseOffsets(GEP->getOperand(1), GEP->getParent(), LI);