Lines Matching defs:GEP
92 /// A vector used to hold the indices of a single GEP instruction
466 // We can only promote this argument if all of the uses are loads, or are GEP
502 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) {
503 V = GEP->getPointerOperand();
506 Indices.reserve(GEP->getNumIndices());
507 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end();
512 // We found a non-constant GEP index for this argument? Bail out
521 // Direct loads are equivalent to a GEP with a single 0 index.
527 // not (GEP+)loads, or any (GEP+)loads that are not safe to promote.
537 // Direct loads are equivalent to a GEP with a zero index and then a load.
539 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(UR)) {
540 if (GEP->use_empty()) {
541 // Dead GEP's cause trouble later. Just remove them if we run into
543 GEP->eraseFromParent();
552 for (User::op_iterator i = GEP->idx_begin(), e = GEP->idx_end();
557 return false; // Not a constant operand GEP!
559 // Ensure that the only users of the GEP are load instructions.
560 for (User *GEPU : GEP->users())
570 return false; // Not a load or a GEP.
573 // Now, see if it is safe to promote this load / loads of this GEP. Loading
649 // handle cases where there are both a direct load and GEP accesses.
655 // what the new GEP/Load instructions we are inserting look like.
711 // and gep+loads with the GEP indices.
791 // Loop over the operands, inserting GEP and loads in the caller as
806 // Emit a GEP and load for each element of the struct.
833 // This satisfies GEP constraints.
841 // And create a GEP to extract those indices.
983 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->user_back());
985 Operands.reserve(GEP->getNumIndices());
986 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end();
997 assert(It != ArgIndices.end() && "GEP not handled??");
1012 while (!GEP->use_empty()) {
1013 LoadInst *L = cast<LoadInst>(GEP->user_back());
1017 GEP->eraseFromParent();