Lines Matching refs:GEP
209 GEPChainInfo &GEP, T *Insn) { in fillCommonArgs() argument
214 Args.push_back(GEP.Members[0]->getPointerOperand()); in fillCommonArgs()
219 Args.push_back(ConstantInt::get(Int1Ty, GEP.InBounds)); in fillCommonArgs()
220 Args.append(GEP.Indices.begin(), GEP.Indices.end()); in fillCommonArgs()
223 static Instruction *makeGEPAndLoad(Module *M, GEPChainInfo &GEP, in makeGEPAndLoad() argument
226 fillCommonArgs(M->getContext(), Args, GEP, Load); in makeGEPAndLoad()
229 setParamElementType(Call, 0, GEP.SourceElementType); in makeGEPAndLoad()
230 Call->applyMergedLocation(mergeDILocations(GEP.Members), Load->getDebugLoc()); in makeGEPAndLoad()
231 Call->setName((*GEP.Members.rbegin())->getName()); in makeGEPAndLoad()
243 static Instruction *makeGEPAndStore(Module *M, GEPChainInfo &GEP, in makeGEPAndStore() argument
247 fillCommonArgs(M->getContext(), Args, GEP, Store); in makeGEPAndStore()
251 setParamElementType(Call, 1, GEP.SourceElementType); in makeGEPAndStore()
254 Call->applyMergedLocation(mergeDILocations(GEP.Members), in makeGEPAndStore()
282 auto *GEP = in reconstructGEP() local
285 GEP->setIsInBounds(getOperandAsUnsigned(Call, 5 + Delta)); in reconstructGEP()
286 return GEP; in reconstructGEP()
290 static void reconstructCommon(CallInst *Call, GetElementPtrInst *GEP, T *Insn, in reconstructCommon() argument
297 GEP->setDebugLoc(Call->getDebugLoc()); in reconstructCommon()
304 GetElementPtrInst *GEP = reconstructGEP(Call, 0); in reconstructLoad() local
306 auto *Load = new LoadInst(ReturnType, GEP, "", in reconstructLoad()
309 reconstructCommon(Call, GEP, Load, 0); in reconstructLoad()
310 return std::pair{GEP, Load}; in reconstructLoad()
315 GetElementPtrInst *GEP = reconstructGEP(Call, 1); in reconstructStore() local
316 auto *Store = new StoreInst(Call->getOperand(0), GEP, in reconstructStore()
319 reconstructCommon(Call, GEP, Store, 1); in reconstructStore()
320 return std::pair{GEP, Store}; in reconstructStore()
336 if (!all_of(GEPs, [=](GetElementPtrInst *GEP) { in foldGEPChainAsStructAccess() argument
337 return GEP->hasAllConstantIndices(); in foldGEPChainAsStructAccess()
349 GetElementPtrInst *GEP = *Iter; in foldGEPChainAsStructAccess() local
350 if (!isZero(*GEP->idx_begin())) { in foldGEPChainAsStructAccess()
354 if (!GEP->getSourceElementType() || in foldGEPChainAsStructAccess()
355 GEP->getSourceElementType() != ResultElementType) { in foldGEPChainAsStructAccess()
359 Info.InBounds &= GEP->isInBounds(); in foldGEPChainAsStructAccess()
360 Info.Indices.append(GEP->idx_begin() + 1, GEP->idx_end()); in foldGEPChainAsStructAccess()
361 Info.Members.push_back(GEP); in foldGEPChainAsStructAccess()
362 ResultElementType = GEP->getResultElementType(); in foldGEPChainAsStructAccess()
381 for (GetElementPtrInst *GEP : GEPs) { in foldGEPChainAsU8Access()
382 if (!GEP->accumulateConstantOffset(DL, Offset)) { in foldGEPChainAsU8Access()
386 Info.InBounds &= GEP->isInBounds(); in foldGEPChainAsU8Access()
387 Info.Members.push_back(GEP); in foldGEPChainAsU8Access()
408 return GEPs.empty() || all_of(GEPs, [=](GetElementPtrInst *GEP) { in allZeroIndices() argument
409 return GEP->hasAllZeroIndices(); in allZeroIndices()
440 if (auto *GEP = dyn_cast<GetElementPtrInst>(U)) in isPointerOperand() local
441 return GEP->getPointerOperand() == I; in isPointerOperand()
526 auto [GEP, Load] = in rewriteAccessChain()
528 GEPs.push_back(GEP); in rewriteAccessChain()
532 delete GEP; in rewriteAccessChain()
537 auto [GEP, Store] = in rewriteAccessChain()
539 GEPs.push_back(GEP); in rewriteAccessChain()
543 delete GEP; in rewriteAccessChain()
544 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(Insn)) { in rewriteAccessChain() local
545 GEPs.push_back(GEP); in rewriteAccessChain()
615 if (auto *GEP = dyn_cast<GetElementPtrInst>(U)) in removePAICalls() local
616 return GEP->getPointerOperand() == Op; in removePAICalls()