Lines Matching refs:GEPs

331 static bool foldGEPChainAsStructAccess(SmallVector<GetElementPtrInst *> &GEPs,  in foldGEPChainAsStructAccess()  argument
333 if (GEPs.empty()) in foldGEPChainAsStructAccess()
336 if (!all_of(GEPs, [=](GetElementPtrInst *GEP) { in foldGEPChainAsStructAccess()
341 GetElementPtrInst *First = GEPs[0]; in foldGEPChainAsStructAccess()
348 for (auto *Iter = GEPs.begin() + 1; Iter != GEPs.end(); ++Iter) { in foldGEPChainAsStructAccess()
371 static bool foldGEPChainAsU8Access(SmallVector<GetElementPtrInst *> &GEPs, in foldGEPChainAsU8Access() argument
373 if (GEPs.empty()) in foldGEPChainAsU8Access()
376 GetElementPtrInst *First = GEPs[0]; in foldGEPChainAsU8Access()
381 for (GetElementPtrInst *GEP : GEPs) { in foldGEPChainAsU8Access()
407 static bool allZeroIndices(SmallVector<GetElementPtrInst *> &GEPs) { in allZeroIndices() argument
408 return GEPs.empty() || all_of(GEPs, [=](GetElementPtrInst *GEP) { in allZeroIndices()
414 SmallVector<GetElementPtrInst *> &GEPs, in tryToReplaceWithGEPBuiltin() argument
417 if (!foldGEPChainAsStructAccess(GEPs, GEPChain) && in tryToReplaceWithGEPBuiltin()
418 !foldGEPChainAsU8Access(GEPs, GEPChain)) { in tryToReplaceWithGEPBuiltin()
456 SmallVector<GetElementPtrInst *> &GEPs,
461 SmallVector<GetElementPtrInst *> &GEPs, in rewriteUses() argument
468 rewriteAccessChain(UI, GEPs, Visited, AllowPatial, StillUsed); in rewriteUses()
502 SmallVector<GetElementPtrInst *> &GEPs, in rewriteAccessChain() argument
507 rewriteUses(Insn, GEPs, Visited, AllowPatial, StillUsed); in rewriteAccessChain()
513 if (allZeroIndices(GEPs)) in rewriteAccessChain()
515 if (tryToReplaceWithGEPBuiltin(LoadOrStore, GEPs, Insn)) { in rewriteAccessChain()
528 GEPs.push_back(GEP); in rewriteAccessChain()
530 GEPs.pop_back(); in rewriteAccessChain()
539 GEPs.push_back(GEP); in rewriteAccessChain()
541 GEPs.pop_back(); in rewriteAccessChain()
545 GEPs.push_back(GEP); in rewriteAccessChain()
547 GEPs.pop_back(); in rewriteAccessChain()
575 SmallVector<GetElementPtrInst *> GEPs; in rewriteAccessChain() local
578 rewriteUses(Marker, GEPs, Visited, AllowPatial, StillUsed); in rewriteAccessChain()