Home | History | Annotate | Download | only in IPO

Lines Matching defs:GEP

81     /// A vector used to hold the indices of a single GEP instruction
440 // We can only promote this argument if all of the uses are loads, or are GEP
476 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) {
477 V = GEP->getPointerOperand();
480 Indices.reserve(GEP->getNumIndices());
481 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end();
486 // We found a non-constant GEP index for this argument? Bail out
495 // Direct loads are equivalent to a GEP with a single 0 index.
501 // not (GEP+)loads, or any (GEP+)loads that are not safe to promote.
511 // Direct loads are equivalent to a GEP with a zero index and then a load.
513 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(UR)) {
514 if (GEP->use_empty()) {
515 // Dead GEP's cause trouble later. Just remove them if we run into
517 GEP->eraseFromParent();
525 for (User::op_iterator i = GEP->idx_begin(), e = GEP->idx_end();
530 return false; // Not a constant operand GEP!
532 // Ensure that the only users of the GEP are load instructions.
533 for (User *GEPU : GEP->users())
543 return false; // Not a load or a GEP.
546 // Now, see if it is safe to promote this load / loads of this GEP. Loading
623 // handle cases where there are both a direct load and GEP accesses.
629 // what the new GEP/Load instructions we are inserting look like.
685 // and gep+loads with the GEP indices.
770 // Loop over the operands, inserting GEP and loads in the caller as
785 // Emit a GEP and load for each element of the struct.
814 // This satisfies GEP constraints.
822 // And create a GEP to extract those indices.
961 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->user_back());
963 Operands.reserve(GEP->getNumIndices());
964 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end();
975 assert(It != ArgIndices.end() && "GEP not handled??");
990 while (!GEP->use_empty()) {
991 LoadInst *L = cast<LoadInst>(GEP->user_back());
995 GEP->eraseFromParent();