Home | History | Annotate | Download | only in InstCombine

Lines Matching refs:GEP

401 Value *InstCombiner::EmitGEPOffset(User *GEP) {
403 gep_type_iterator GTI = gep_type_begin(GEP);
404 Type *IntPtrTy = TD.getIntPtrType(GEP->getContext());
407 // If the GEP is inbounds, we know that none of the addressing operations will
409 bool isInBounds = cast<GEPOperator>(GEP)->isInBounds();
415 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;
428 GEP->getName()+".offs");
437 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs");
446 GEP->getName()+".idx", isInBounds /*NUW*/);
450 Result = Builder->CreateAdd(Op, Result, GEP->getName()+".offs");
466 // If LHS is a gep based on RHS or RHS is a gep based on LHS, we can optimize
469 GetElementPtrInst *GEP = 0;
476 // (gep X, ...) - X
478 GEP = LHSGEP;
481 // (gep X, ...) - (ce_gep X, ...)
485 GEP = LHSGEP;
492 // X - (gep X, ...)
494 GEP = RHSGEP;
497 // (ce_gep X, ...) - (gep X, ...)
501 GEP = RHSGEP;
507 if (GEP == 0)
510 // Emit the offset of the GEP and an intptr_t.
511 Value *Result = EmitGEPOffset(GEP);
513 // If we had a constant expression GEP on the other side offsetting the
521 // If we have p - gep(p, ...) then we have to negate the result.