Searched defs:GEP (Results 1 - 23 of 23) sorted by relevance

/external/llvm/include/llvm/Transforms/Utils/
H A DLocal.h178 Value *EmitGEPOffset(IRBuilderTy *Builder, const TargetData &TD, User *GEP, argument
180 gep_type_iterator GTI = gep_type_begin(GEP);
181 Type *IntPtrTy = TD.getIntPtrType(GEP->getContext());
184 // If the GEP is inbounds, we know that none of the addressing operations will
186 bool isInBounds = cast<GEPOperator>(GEP)->isInBounds() && !NoAssumptions;
192 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;
205 GEP->getName()+".offs");
213 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs");
222 GEP
[all...]
/external/llvm/include/llvm/Support/
H A DGetElementPtrTypeIterator.h85 inline gep_type_iterator gep_type_begin(const User *GEP) { argument
86 return gep_type_iterator::begin(GEP->getOperand(0)->getType(),
87 GEP->op_begin()+1);
89 inline gep_type_iterator gep_type_end(const User *GEP) { argument
90 return gep_type_iterator::end(GEP->op_end());
92 inline gep_type_iterator gep_type_begin(const User &GEP) { argument
93 return gep_type_iterator::begin(GEP.getOperand(0)->getType(),
94 GEP.op_begin()+1);
96 inline gep_type_iterator gep_type_end(const User &GEP) { argument
97 return gep_type_iterator::end(GEP
[all...]
/external/llvm/unittests/Transforms/Utils/
H A DCloning.cpp129 GetElementPtrInst *GEP = GetElementPtrInst::Create(V, ops); local
130 EXPECT_FALSE(this->clone(GEP)->isInBounds());
132 GEP->setIsInBounds();
133 EXPECT_TRUE(this->clone(GEP)->isInBounds());
/external/llvm/lib/Transforms/Scalar/
H A DGlobalMerge.cpp159 Constant *GEP = ConstantExpr::getInBoundsGetElementPtr(MergedGV, Idx); local
160 Globals[k]->replaceAllUsesWith(GEP);
H A DMemCpyOptimizer.cpp41 static int64_t GetOffsetFromIndex(const GetElementPtrInst *GEP, unsigned Idx, argument
44 gep_type_iterator GTI = gep_type_begin(GEP);
50 for (unsigned i = Idx, e = GEP->getNumOperands(); i != e; ++i, ++GTI) {
51 ConstantInt *OpC = dyn_cast<ConstantInt>(GEP->getOperand(i));
83 // If one pointer is a GEP and the other isn't, then see if the GEP is a
103 // Skip any common indices and track the GEP types.
/external/llvm/lib/Transforms/InstCombine/
H A DInstCombineLoadStoreAlloca.cpp69 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
70 // If the GEP has all zero indices, it doesn't offset the pointer. If it
72 if (!isOnlyCopiedFromConstantGlobal(GEP, TheCopy, ToDelete,
73 IsOffset || !GEP->hasAllZeroIndices()))
206 Instruction *GEP = local
208 InsertNewInstBefore(GEP, *It);
212 return ReplaceInstUsesWith(AI, GEP);
533 // emit a GEP to index into its first field.
601 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) {
602 if (isa<AllocaInst>(GEP
[all...]
H A DInstCombinePHI.cpp135 // This is true if all GEP bases are allocas and if all indices into them are
148 GetElementPtrInst *GEP= dyn_cast<GetElementPtrInst>(PN.getIncomingValue(i)); local
149 if (!GEP || !GEP->hasOneUse() || GEP->getType() != FirstInst->getType() ||
150 GEP->getNumOperands() != FirstInst->getNumOperands())
153 AllInBounds &= GEP->isInBounds();
157 (!isa<AllocaInst>(GEP->getOperand(0)) ||
158 !GEP->hasAllConstantIndices()))
163 if (FirstInst->getOperand(op) == GEP
[all...]
H A DInstCombineCompares.cpp202 FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, GlobalVariable *GV, argument
205 if (!GEP->isInBounds() && TD == 0) return 0;
217 // Require: GEP GV, 0, i {{, constant indices}}
218 if (GEP->getNumOperands() < 3 ||
219 !isa<ConstantInt>(GEP->getOperand(1)) ||
220 !cast<ConstantInt>(GEP->getOperand(1))->isZero() ||
221 isa<Constant>(GEP->getOperand(2)))
230 for (unsigned i = 3, e = GEP->getNumOperands(); i != e; ++i) {
231 ConstantInt *Idx = dyn_cast<ConstantInt>(GEP->getOperand(i));
366 Value *Idx = GEP
476 EvaluateGEPOffsetExpression(User *GEP, InstCombiner &IC) argument
[all...]
H A DInstructionCombining.cpp90 Value *InstCombiner::EmitGEPOffset(User *GEP) { argument
91 return llvm::EmitGEPOffset(Builder, *getTargetData(), GEP);
738 /// or not there is a sequence of GEP indices into the type that will land us at
798 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { argument
799 // If this GEP has only 0 indices, it is the same pointer as
800 // Src. If Src is not a trivial GEP too, don't combine
802 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() &&
808 Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { argument
809 SmallVector<Value*, 8> Ops(GEP.op_begin(), GEP
1454 Value *GEP = Builder->CreateInBoundsGEP(L->getPointerOperand(), Indices); local
[all...]
/external/llvm/lib/Analysis/
H A DInlineCost.cpp93 bool isGEPOffsetConstant(GetElementPtrInst &GEP);
94 bool accumulateGEPOffset(GEPOperator &GEP, APInt &Offset);
222 /// \brief Check whether a GEP's indices are all constant.
225 bool CallAnalyzer::isGEPOffsetConstant(GetElementPtrInst &GEP) { argument
226 for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I)
233 /// \brief Accumulate a constant GEP offset into an APInt if possible.
237 bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) { argument
244 for (gep_type_iterator GTI = gep_type_begin(GEP), GTE = gep_type_end(GEP);
[all...]
H A DMemoryBuiltins.cpp394 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V))
395 return visitGEPOperator(*GEP);
511 SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) { argument
512 SizeOffsetType PtrData = compute(GEP.getPointerOperand());
513 if (!bothKnown(PtrData) || !GEP.hasAllConstantIndices())
516 SmallVector<Value*, 8> Ops(GEP.idx_begin(), GEP.idx_end());
517 APInt Offset(IntTyBits,TD->getIndexedOffset(GEP.getPointerOperandType(),Ops));
615 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
616 Result = visitGEPOperator(*GEP);
694 visitGEPOperator(GEPOperator &GEP) argument
[all...]
H A DInstructionSimplify.cpp660 /// \brief Accumulate the constant integer offset a GEP represents.
664 /// if the GEP has all-constant indices. Returns false if any non-constant
667 static bool accumulateGEPOffset(const TargetData &TD, GEPOperator *GEP, argument
672 gep_type_iterator GTI = gep_type_begin(GEP);
673 for (User::op_iterator I = GEP->op_begin() + 1, E = GEP->op_end(); I != E;
712 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
713 if (!GEP->isInBounds() || !accumulateGEPOffset(TD, GEP, Offset))
715 V = GEP
[all...]
H A DScalarEvolutionExpander.cpp336 /// into GEP indices.
370 /// a GEP instead of using ptrtoint+arithmetic+inttoptr. This helps
411 // operands into GEP indices, at each level. The first index in a GEP
513 // If none of the operands were convertible to proper GEP indices, cast
527 // Fold a GEP with constant operands.
532 // Do a quick scan to see if we have this GEP nearby. If so, reuse it.
565 // Emit a GEP.
566 Value *GEP = Builder.CreateGEP(V, Idx, "uglygep"); local
567 rememberInstruction(GEP);
607 Value *GEP = Builder.CreateGEP(Casted, local
[all...]
/external/llvm/lib/Transforms/IPO/
H A DArgumentPromotion.cpp73 /// A vector used to hold the indices of a single GEP instruction
315 // We can only promote this argument if all of the uses are loads, or are GEP
349 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) {
350 V = GEP->getPointerOperand();
353 Indices.reserve(GEP->getNumIndices());
354 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end();
359 // We found a non-constant GEP index for this argument? Bail out
368 // Direct loads are equivalent to a GEP with a single 0 index.
374 // not (GEP
832 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->use_back()); local
[all...]
H A DGlobalOpt.cpp264 // PHI nodes we can check just like select or GEP instructions, but we
364 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) {
365 if (!GEP->hasAllConstantIndices())
499 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
504 if (!isa<ConstantExpr>(GEP->getOperand(0))) {
506 dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP, TD, TLI));
510 // If the initializer is an all-null value and we have an inbounds GEP,
511 // we already know what the result of any load from that GEP is.
513 if (Init && isa<ConstantAggregateZero>(Init) && GEP->isInBounds())
514 SubInit = Constant::getNullValue(GEP
742 User *GEP = GV->use_back(); local
[all...]
/external/llvm/lib/Transforms/Utils/
H A DCodeExtractor.cpp365 GetElementPtrInst *GEP = local
367 RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI);
467 GetElementPtrInst *GEP = local
470 codeReplacer->getInstList().push_back(GEP);
471 StoreInst *SI = new StoreInst(StructValues[i], GEP);
493 GetElementPtrInst *GEP local
496 codeReplacer->getInstList().push_back(GEP);
497 Output = GEP;
608 GetElementPtrInst *GEP = local
612 new StoreInst(outputs[out], GEP, NTRe
[all...]
H A DSimplifyCFG.cpp3117 // GEP needs a runtime relocation in PIC code. We should just build one big
3228 Value *GEP = Builder.CreateInBoundsGEP(LookupTables[PHI], GEPIndices, local
3230 Value *Result = Builder.CreateLoad(GEP, "switch.load");
3475 // Look through GEPs. A load from a GEP derived from NULL is still undefined
3476 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Use))
3477 if (GEP->getPointerOperand() == I)
3478 return passingValueIsAlwaysUndefined(V, GEP);
/external/llvm/tools/bugpoint/
H A DMiscompilation.cpp836 Value *GEP = ConstantExpr::getGetElementPtr(funcName, GEPargs); local
838 ResolverArgs.push_back(GEP);
/external/llvm/lib/Transforms/Instrumentation/
H A DGCOVProfiling.cpp730 Value *GEP = Builder.CreateGEP(Arg, ZExtPred); local
731 Value *Counter = Builder.CreateLoad(GEP, "counter");
/external/llvm/lib/VMCore/
H A DConstants.cpp613 /// getElementValue - Return a zero of the right value for the specified GEP
621 /// getElementValue - Return a zero of the right value for the specified GEP
646 /// getElementValue - Return an undef of the right value for the specified GEP
654 /// getElementValue - Return an undef of the right value for the specified GEP
1665 Constant *GEP = getGetElementPtr( local
1667 return getPtrToInt(GEP,
1680 Constant *GEP = getGetElementPtr(NullPtr, Indices); local
1681 return getPtrToInt(GEP,
1697 Constant *GEP = getGetElementPtr( local
1699 return getPtrToInt(GEP,
[all...]
H A DVerifier.cpp272 void visitGetElementPtrInst(GetElementPtrInst &GEP);
1327 void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) { argument
1328 Type *TargetTy = GEP.getPointerOperandType()->getScalarType();
1331 "GEP base pointer is not a vector or a vector of pointers", &GEP); local
1333 "GEP into unsized type!", &GEP);
1335 SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end());
1337 GetElementPtrInst::getIndexedType(GEP
[all...]
/external/clang/lib/CodeGen/
H A DCGExprCXX.cpp1560 // We might be deleting a pointer to array. If so, GEP down to the
1566 SmallVector<llvm::Value*,8> GEP; local
1568 GEP.push_back(Zero); // point at the outermost array
1576 // 2. GEP to the first element of the array.
1577 GEP.push_back(Zero);
1580 Ptr = Builder.CreateInBoundsGEP(Ptr, GEP, "del.first");
/external/llvm/include/llvm/
H A DInstructions.h750 GetElementPtrInst *GEP = Create(Ptr, IdxList, NameStr, InsertBefore); local
751 GEP->setIsInBounds(true);
752 return GEP;
758 GetElementPtrInst *GEP = Create(Ptr, IdxList, NameStr, InsertAtEnd); local
759 GEP->setIsInBounds(true);
760 return GEP;
781 /// getIndexedType - Returns the address space used by the GEP pointer.
810 /// GetGEPReturnType - Returns the pointer type returned by the GEP
816 // Vector GEP
822 // Scalar GEP
[all...]

Completed in 1039 milliseconds