Lines Matching refs:GEP
210 GEPChainInfo &GEP, T *Insn) { in fillCommonArgs() argument
215 Args.push_back(GEP.Members[0]->getPointerOperand()); in fillCommonArgs()
220 Args.push_back(ConstantInt::get(Int1Ty, GEP.InBounds)); in fillCommonArgs()
221 Args.append(GEP.Indices.begin(), GEP.Indices.end()); in fillCommonArgs()
224 static Instruction *makeGEPAndLoad(Module *M, GEPChainInfo &GEP, in makeGEPAndLoad() argument
227 fillCommonArgs(M->getContext(), Args, GEP, Load); in makeGEPAndLoad()
230 setParamElementType(Call, 0, GEP.SourceElementType); in makeGEPAndLoad()
231 Call->applyMergedLocation(mergeDILocations(GEP.Members), Load->getDebugLoc()); in makeGEPAndLoad()
232 Call->setName((*GEP.Members.rbegin())->getName()); in makeGEPAndLoad()
244 static Instruction *makeGEPAndStore(Module *M, GEPChainInfo &GEP, in makeGEPAndStore() argument
248 fillCommonArgs(M->getContext(), Args, GEP, Store); in makeGEPAndStore()
252 setParamElementType(Call, 1, GEP.SourceElementType); in makeGEPAndStore()
255 Call->applyMergedLocation(mergeDILocations(GEP.Members), in makeGEPAndStore()
283 auto *GEP = in reconstructGEP() local
286 GEP->setIsInBounds(getOperandAsUnsigned(Call, 5 + Delta)); in reconstructGEP()
287 return GEP; in reconstructGEP()
291 static void reconstructCommon(CallInst *Call, GetElementPtrInst *GEP, T *Insn, in reconstructCommon() argument
298 GEP->setDebugLoc(Call->getDebugLoc()); in reconstructCommon()
305 GetElementPtrInst *GEP = reconstructGEP(Call, 0); in reconstructLoad() local
307 auto *Load = new LoadInst(ReturnType, GEP, "", in reconstructLoad()
310 reconstructCommon(Call, GEP, Load, 0); in reconstructLoad()
311 return std::pair{GEP, Load}; in reconstructLoad()
316 GetElementPtrInst *GEP = reconstructGEP(Call, 1); in reconstructStore() local
317 auto *Store = new StoreInst(Call->getOperand(0), GEP, in reconstructStore()
320 reconstructCommon(Call, GEP, Store, 1); in reconstructStore()
321 return std::pair{GEP, Store}; in reconstructStore()
337 if (!all_of(GEPs, [=](GetElementPtrInst *GEP) { in foldGEPChainAsStructAccess() argument
338 return GEP->hasAllConstantIndices(); in foldGEPChainAsStructAccess()
350 GetElementPtrInst *GEP = *Iter; in foldGEPChainAsStructAccess() local
351 if (!isZero(*GEP->idx_begin())) { in foldGEPChainAsStructAccess()
355 if (!GEP->getSourceElementType() || in foldGEPChainAsStructAccess()
356 GEP->getSourceElementType() != ResultElementType) { in foldGEPChainAsStructAccess()
360 Info.InBounds &= GEP->isInBounds(); in foldGEPChainAsStructAccess()
361 Info.Indices.append(GEP->idx_begin() + 1, GEP->idx_end()); in foldGEPChainAsStructAccess()
362 Info.Members.push_back(GEP); in foldGEPChainAsStructAccess()
363 ResultElementType = GEP->getResultElementType(); in foldGEPChainAsStructAccess()
382 for (GetElementPtrInst *GEP : GEPs) { in foldGEPChainAsU8Access()
383 if (!GEP->accumulateConstantOffset(DL, Offset)) { in foldGEPChainAsU8Access()
387 Info.InBounds &= GEP->isInBounds(); in foldGEPChainAsU8Access()
388 Info.Members.push_back(GEP); in foldGEPChainAsU8Access()
409 return GEPs.empty() || all_of(GEPs, [=](GetElementPtrInst *GEP) { in allZeroIndices() argument
410 return GEP->hasAllZeroIndices(); in allZeroIndices()
441 if (auto *GEP = dyn_cast<GetElementPtrInst>(U)) in isPointerOperand() local
442 return GEP->getPointerOperand() == I; in isPointerOperand()
527 auto [GEP, Load] = in rewriteAccessChain()
529 GEPs.push_back(GEP); in rewriteAccessChain()
533 delete GEP; in rewriteAccessChain()
538 auto [GEP, Store] = in rewriteAccessChain()
540 GEPs.push_back(GEP); in rewriteAccessChain()
544 delete GEP; in rewriteAccessChain()
545 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(Insn)) { in rewriteAccessChain() local
546 GEPs.push_back(GEP); in rewriteAccessChain()
616 if (auto *GEP = dyn_cast<GetElementPtrInst>(U)) in removePAICalls() local
617 return GEP->getPointerOperand() == Op; in removePAICalls()