Home | History | Annotate | Download | only in IPO

Lines Matching defs:GEP

76     /// A vector used to hold the indices of a single GEP instruction
321 // We can only promote this argument if all of the uses are loads, or are GEP
358 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) {
359 V = GEP->getPointerOperand();
362 Indices.reserve(GEP->getNumIndices());
363 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end();
368 // We found a non-constant GEP index for this argument? Bail out
377 // Direct loads are equivalent to a GEP with a single 0 index.
383 // not (GEP+)loads, or any (GEP+)loads that are not safe to promote.
393 // Direct loads are equivalent to a GEP with a zero index and then a load.
395 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(UR)) {
396 if (GEP->use_empty()) {
397 // Dead GEP
399 getAnalysis<AliasAnalysis>().deleteValue(GEP);
400 GEP->eraseFromParent();
408 for (User::op_iterator i = GEP->idx_begin(), e = GEP->idx_end();
413 return false; // Not a constant operand GEP!
415 // Ensure that the only users of the GEP are load instructions.
416 for (User *GEPU : GEP->users())
426 return false; // Not a load or a GEP.
429 // Now, see if it is safe to promote this load / loads of this GEP. Loading
511 // handle cases where there are both a direct load and GEP accesses.
517 // what the new GEP/Load instructions we are inserting look like.
570 // and gep+loads with the GEP indices.
658 // Loop over the operands, inserting GEP and loads in the caller as
673 // Emit a GEP and load for each element of the struct.
702 // This satisfies GEP constraints.
710 // And create a GEP to extract those indices.
858 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->user_back());
860 Operands.reserve(GEP->getNumIndices());
861 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end();
872 assert(It != ArgIndices.end() && "GEP not handled??");
887 while (!GEP->use_empty()) {
888 LoadInst *L = cast<LoadInst>(GEP->user_back());
893 AA.deleteValue(GEP);
894 GEP->eraseFromParent();