/external/llvm/include/llvm/Support/ |
H A D | GetElementPtrTypeIterator.h | 85 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/include/llvm/Transforms/Utils/ |
H A D | Local.h | 178 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/lib/Transforms/InstCombine/ |
H A D | InstructionCombining.cpp | 90 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...] |
H A D | 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)); 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 D | 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())) 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 D | InstCombineCompares.cpp | 202 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 D | InstCombineCasts.cpp | 1321 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Src)) { 1324 if (GEP->hasAllZeroIndices()) { 1328 Worklist.Add(GEP); 1329 CI.setOperand(0, GEP->getOperand(0)); 1333 // If the GEP has a single use, and the base pointer is a bitcast, and the 1334 // GEP computes a constant offset, see if we can convert these three 1337 if (TD && GEP->hasOneUse() && isa<BitCastInst>(GEP->getOperand(0)) && 1338 GEP->hasAllConstantIndices()) { 1339 SmallVector<Value*, 8> Ops(GEP [all...] |
H A D | InstCombine.h | 142 Instruction *FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, 188 Instruction *visitGetElementPtrInst(GetElementPtrInst &GEP); 229 Value *EmitGEPOffset(User *GEP);
|
/external/llvm/unittests/Transforms/Utils/ |
H A D | Cloning.cpp | 129 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/Analysis/ |
H A D | 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)) { 402 BasicBlock *CurBB = GEP [all...] |
H A D | Loads.cpp | 62 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 63 if (!GEP->hasAllConstantIndices()) 65 SmallVector<Value*, 8> Indices(GEP->op_begin() + 1, GEP->op_end()); 66 ByteOffset += TD->getIndexedOffset(GEP->getPointerOperandType(), 68 V = GEP->getPointerOperand();
|
H A D | MemoryBuiltins.cpp | 394 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 D | CodeMetrics.cpp | 61 // If a GEP has all constant indices, it will probably be folded with 63 if (const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) 64 return GEP->hasAllConstantIndices();
|
H A D | InlineCost.cpp | 93 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 D | ValueTracking.cpp | 1594 // If this is a GEP with constant indices, we can look through it. 1595 GEPOperator *GEP = dyn_cast<GEPOperator>(PtrOp); 1596 if (GEP == 0 || !GEP->hasAllConstantIndices()) return Ptr; 1598 gep_type_iterator GTI = gep_type_begin(GEP); 1599 for (User::op_iterator I = GEP->idx_begin(), E = GEP->idx_end(); I != E; 1619 return GetPointerBaseWithConstantOffset(GEP->getPointerOperand(), Offset, TD); 1633 // If the value is a GEP instructionor constant expression, treat it as an 1635 if (const GEPOperator *GEP [all...] |
/external/llvm/lib/VMCore/ |
H A D | Value.cpp | 344 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 347 if (!GEP->hasAllZeroIndices()) 351 if (!GEP->hasAllConstantIndices()) 355 if (!GEP->isInBounds()) 359 V = GEP->getPointerOperand(); 411 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 413 if (!Visited.insert(GEP->getOperand(0))) 415 if (!isDereferenceablePointer(GEP->getOperand(0), Visited)) 418 gep_type_iterator GTI = gep_type_begin(GEP); 419 for (User::const_op_iterator I = GEP [all...] |
H A D | Verifier.cpp | 272 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/llvm/lib/Transforms/IPO/ |
H A D | ArgumentPromotion.cpp | 73 /// 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 D | GlobalOpt.cpp | 264 // 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/Scalar/ |
H A D | GlobalMerge.cpp | 159 Constant *GEP = ConstantExpr::getInBoundsGetElementPtr(MergedGV, Idx); local 160 Globals[k]->replaceAllUsesWith(GEP);
|
H A D | 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 add [all...] |
/external/llvm/lib/Transforms/Utils/ |
H A D | CodeExtractor.cpp | 365 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...] |
/external/llvm/include/llvm/Analysis/ |
H A D | MemoryBuiltins.h | 193 SizeOffsetType visitGEPOperator(GEPOperator &GEP); 255 SizeOffsetEvalType visitGEPOperator(GEPOperator &GEP);
|
/external/llvm/lib/Target/NVPTX/ |
H A D | 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();
|
/external/llvm/lib/Transforms/Instrumentation/ |
H A D | ThreadSanitizer.cpp | 179 // If this is a GEP, just analyze its pointer operand. 180 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Addr)) 181 Addr = GEP->getPointerOperand();
|