HomeSort by relevance Sort by last modified time
    Searched refs:GEP (Results 1 - 25 of 44) sorted by null

1 2

  /external/llvm/include/llvm/Support/
GetElementPtrTypeIterator.h 85 inline gep_type_iterator gep_type_begin(const User *GEP) {
87 (GEP->getOperand(0)->getType()->getScalarType(), GEP->op_begin()+1);
89 inline gep_type_iterator gep_type_end(const User *GEP) {
90 return gep_type_iterator::end(GEP->op_end());
92 inline gep_type_iterator gep_type_begin(const User &GEP) {
94 (GEP.getOperand(0)->getType()->getScalarType(), GEP.op_begin()+1);
96 inline gep_type_iterator gep_type_end(const User &GEP) {
97 return gep_type_iterator::end(GEP.op_end())
    [all...]
  /external/llvm/include/llvm/Transforms/Utils/
Local.h 180 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP,
182 gep_type_iterator GTI = gep_type_begin(GEP);
183 Type *IntPtrTy = TD.getIntPtrType(GEP->getContext());
186 // If the GEP is inbounds, we know that none of the addressing operations will
188 bool isInBounds = cast<GEPOperator>(GEP)->isInBounds() && !NoAssumptions;
194 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;
207 GEP->getName()+".offs");
215 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs");
224 GEP->getName()+".idx", isInBounds /*NUW*/)
    [all...]
  /external/llvm/lib/Transforms/InstCombine/
InstructionCombining.cpp 96 Value *InstCombiner::EmitGEPOffset(User *GEP) {
97 return llvm::EmitGEPOffset(Builder, *getDataLayout(), GEP);
759 /// or not there is a sequence of GEP indices into the type that will land us at
819 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) {
820 // If this GEP has only 0 indices, it is the same pointer as
821 // Src. If Src is not a trivial GEP too, don't combine
823 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() &&
    [all...]
InstCombinePHI.cpp 135 // 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));
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->getOperand(op)
    [all...]
InstCombineLoadStoreAlloca.cpp 69 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()))
187 Instruction *GEP =
189 InsertNewInstBefore(GEP, *It);
193 return ReplaceInstUsesWith(AI, GEP);
300 // see if a trivial 'gep P, 0, 0' will help matters. Only do this for
370 // load(gep null, ...) -> unreachable
462 /// NewGEPIndices - If SrcPTy is an aggregate type, we can emit a "noop gep"
    [all...]
InstCombineCompares.cpp 194 /// cmp pred (load (gep GV, ...)), cmpcst
197 /// we can optimize "icmp eq (load (gep "foo", 0, i)), 0" into "icmp eq i, 3".
202 FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, GlobalVariable *GV,
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)
    [all...]
InstCombine.h 148 Instruction *FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP,
194 Instruction *visitGetElementPtrInst(GetElementPtrInst &GEP);
235 Value *EmitGEPOffset(User *GEP);
InstCombineCasts.cpp     [all...]
  /external/llvm/lib/Analysis/
PHITransAddr.cpp 217 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) {
220 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) {
221 Value *GEPOp = PHITranslateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT);
224 AnyChanged |= GEPOp != GEP->getOperand(i);
229 return GEP;
231 // Simplify the GEP to handle 'gep x, 0' -> x etc.
239 // Scan to see if we have this GEP available.
244 if (GEPI->getType() == GEP->getType() &&
400 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst))
    [all...]
MemoryBuiltins.cpp 422 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V))
423 Result = visitGEPOperator(*GEP);
542 SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) {
543 SizeOffsetType PtrData = compute(GEP.getPointerOperand());
545 if (!bothKnown(PtrData) || !GEP.accumulateConstantOffset(*TD, Offset))
663 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
664 Result = visitGEPOperator(*GEP);
743 ObjectSizeOffsetEvaluator::visitGEPOperator(GEPOperator &GEP) {
744 SizeOffsetEvalType PtrData = compute_(GEP.getPointerOperand());
748 Value *Offset = EmitGEPOffset(&Builder, *TD, &GEP, /*NoAssumptions=*/true)
    [all...]
ValueTracking.cpp     [all...]
TargetTransformInfo.cpp 242 llvm_unreachable("Use getGEPCost for GEP operations!");
376 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(U))
379 return GEP->hasAllConstantIndices() ? TCC_Free : TCC_Basic;
  /external/llvm/lib/Transforms/IPO/
ArgumentPromotion.cpp 73 /// A vector used to hold the indices of a single GEP instruction
316 // We can only promote this argument if all of the uses are loads, or are GEP
350 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) {
351 V = GEP->getPointerOperand();
354 Indices.reserve(GEP->getNumIndices());
355 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end();
360 // We found a non-constant GEP index for this argument? Bail out
369 // Direct loads are equivalent to a GEP with a single 0 index.
375 // not (GEP+)loads, or any (GEP+)loads that are not safe to promote
    [all...]
GlobalOpt.cpp 269 // PHI nodes we can check just like select or GEP instructions, but we
368 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) {
369 if (!GEP->hasAllConstantIndices())
503 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
504 // Do not transform "gepinst (gep constexpr (GV))" here, because forming
505 // "gepconstexpr (gep constexpr (GV))" will cause the two gep's to fold
508 if (!isa<ConstantExpr>(GEP->getOperand(0))) {
510 dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP, TD, TLI));
514 // If the initializer is an all-null value and we have an inbounds GEP,
    [all...]
  /external/llvm/lib/IR/
Value.cpp 351 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
354 if (!GEP->hasAllZeroIndices())
358 if (!GEP->hasAllConstantIndices())
362 if (!GEP->isInBounds())
366 V = GEP->getPointerOperand();
418 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
420 if (!Visited.insert(GEP->getOperand(0)))
422 if (!isDereferenceablePointer(GEP->getOperand(0), Visited))
425 gep_type_iterator GTI = gep_type_begin(GEP);
426 for (User::const_op_iterator I = GEP->op_begin()+1
    [all...]
Verifier.cpp 276 void visitGetElementPtrInst(GetElementPtrInst &GEP);
    [all...]
  /external/llvm/unittests/Transforms/Utils/
Cloning.cpp 132 GetElementPtrInst *GEP = GetElementPtrInst::Create(V, ops);
133 EXPECT_FALSE(this->clone(GEP)->isInBounds());
135 GEP->setIsInBounds();
136 EXPECT_TRUE(this->clone(GEP)->isInBounds());
  /external/llvm/lib/Analysis/IPA/
InlineCost.cpp 101 bool isGEPOffsetConstant(GetElementPtrInst &GEP);
102 bool accumulateGEPOffset(GEPOperator &GEP, APInt &Offset);
234 /// \brief Check whether a GEP's indices are all constant.
237 bool CallAnalyzer::isGEPOffsetConstant(GetElementPtrInst &GEP) {
238 for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I)
245 /// \brief Accumulate a constant GEP offset into an APInt if possible.
249 bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) {
256 for (gep_type_iterator GTI = gep_type_begin(GEP), GTE = gep_type_end(GEP);
    [all...]
  /external/llvm/lib/Transforms/Utils/
CodeExtractor.cpp 366 GetElementPtrInst *GEP =
368 RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI);
468 GetElementPtrInst *GEP =
471 codeReplacer->getInstList().push_back(GEP);
472 StoreInst *SI = new StoreInst(StructValues[i], GEP);
494 GetElementPtrInst *GEP
497 codeReplacer->getInstList().push_back(GEP);
498 Output = GEP;
609 GetElementPtrInst *GEP =
613 new StoreInst(outputs[out], GEP, NTRet)
    [all...]
  /external/llvm/include/llvm/Analysis/
MemoryBuiltins.h 205 SizeOffsetType visitGEPOperator(GEPOperator &GEP);
268 SizeOffsetEvalType visitGEPOperator(GEPOperator &GEP);
  /external/llvm/lib/CodeGen/
StackProtector.cpp 179 } else if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
180 if (HasAddressTaken(GEP))
  /external/llvm/lib/Transforms/Scalar/
GlobalMerge.cpp 187 Constant *GEP = ConstantExpr::getInBoundsGetElementPtr(MergedGV, Idx);
188 Globals[k]->replaceAllUsesWith(GEP);
ScalarReplAggregates.cpp 503 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) {
504 // If this is a GEP with a variable indices, we can't handle it.
505 PointerType* PtrTy = dyn_cast<PointerType>(GEP->getPointerOperandType());
509 // Compute the offset that this GEP adds to the pointer.
510 SmallVector<Value*, 8> Indices(GEP->op_begin()+1, GEP->op_end());
512 if (!GEP->hasAllConstantIndices()) {
526 if (!CanConvertToScalar(GEP, Offset+GEPOffset, GEPNonConstantIdx))
608 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) {
609 // Compute the offset that this GEP adds to the pointer
    [all...]
MemCpyOptimizer.cpp 41 static int64_t GetOffsetFromIndex(const GEPOperator *GEP, unsigned Idx,
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
84 // constant offset from the base, as in "P" and "gep P, 1".
103 // Skip any common indices and track the GEP types.
    [all...]
  /external/llvm/lib/Target/NVPTX/
NVPTXUtilities.cpp 338 // provide an option to ignore GEP indicies for find out the base address only
350 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
351 V = GEP->getPointerOperand()->stripPointerCasts();
360 // - ignore GEP indicies for find out the base address only, and
382 } else if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
383 V = GEP->getPointerOperand()->stripPointerCasts();

Completed in 756 milliseconds

1 2