/external/llvm/include/llvm/Support/ |
GetElementPtrTypeIterator.h | 85 inline gep_type_iterator gep_type_begin(const User *GEP) { 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) { 90 return gep_type_iterator::end(GEP->op_end()); 92 inline gep_type_iterator gep_type_begin(const User &GEP) { 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) { 97 return gep_type_iterator::end(GEP.op_end()) [all...] |
/external/llvm/lib/Analysis/ |
Loads.cpp | 61 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 62 if (!GEP->hasAllConstantIndices()) 64 SmallVector<Value*, 8> Indices(GEP->op_begin() + 1, GEP->op_end()); 65 ByteOffset += TD->getIndexedOffset(GEP->getPointerOperandType(), 67 V = GEP->getPointerOperand();
|
PHITransAddr.cpp | 216 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { 219 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) { 220 Value *GEPOp = PHITranslateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT); 223 AnyChanged |= GEPOp != GEP->getOperand(i); 228 return GEP; 230 // Simplify the GEP to handle 'gep x, 0' -> x etc. 238 // Scan to see if we have this GEP available. 243 if (GEPI->getType() == GEP->getType() && 399 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) [all...] |
ValueTracking.cpp | [all...] |
InlineCost.cpp | 121 // If a GEP has all constant indices, it will probably be folded with 208 else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { 209 // If the GEP has variable indices, we won't be able to do much with it. 210 if (GEP->hasAllConstantIndices()) 211 Reduction += CountCodeReductionForAlloca(GEP);
|
ScalarEvolutionExpander.cpp | 310 /// into GEP indices. 344 /// a GEP instead of using ptrtoint+arithmetic+inttoptr. This helps 385 // operands into GEP indices, at each level. The first index in a GEP 487 // If none of the operands were convertible to proper GEP indices, cast 498 // Fold a GEP with constant operands. 503 // Do a quick scan to see if we have this GEP nearby. If so, reuse it. 536 // Emit a GEP. 537 Value *GEP = Builder.CreateGEP(V, Idx, "uglygep"); 538 rememberInstruction(GEP); [all...] |
ScalarEvolution.cpp | [all...] |
/external/llvm/lib/Transforms/InstCombine/ |
InstructionCombining.cpp | 729 /// or not there is a sequence of GEP indices into the type that will land us at 789 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { 790 // If this GEP has only 0 indices, it is the same pointer as 791 // Src. If Src is not a trivial GEP too, don't combine 793 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && 799 Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { 800 SmallVector<Value*, 8> Ops(GEP.op_begin(), GEP.op_end()); 803 return ReplaceInstUsesWith(GEP, V); 805 Value *PtrOp = GEP.getOperand(0) [all...] |
InstCombineAddSub.cpp | 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*/) [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 | 60 Instruction *GEP = 62 InsertNewInstBefore(GEP, *It); 66 return ReplaceInstUsesWith(AI, GEP); 107 // see if a trivial 'gep P, 0, 0' will help matters. Only do this for 177 // load(gep null, ...) -> unreachable 269 /// NewGEPIndices - If SrcPTy is an aggregate type, we can emit a "noop gep" 276 // see if a trivial 'gep P, 0, 0' will help matters. Only do this for 329 // emit a GEP to index into its first field. 397 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) { 398 if (isa<AllocaInst>(GEP->getOperand(0))) [all...] |
InstCombineCompares.cpp | 193 /// cmp pred (load (gep GV, ...)), cmpcst 196 /// we can optimize "icmp eq (load (gep "foo", 0, i)), 0" into "icmp eq i, 3". 201 FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, GlobalVariable *GV, 204 if (!GEP->isInBounds() && TD == 0) return 0; 212 // Require: GEP GV, 0, i {{, constant indices}} 213 if (GEP->getNumOperands() < 3 || 214 !isa<ConstantInt>(GEP->getOperand(1)) || 215 !cast<ConstantInt>(GEP->getOperand(1))->isZero() || 216 isa<Constant>(GEP->getOperand(2))) 225 for (unsigned i = 3, e = GEP->getNumOperands(); i != e; ++i) [all...] |
InstCombine.h | 138 Instruction *FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, 184 Instruction *visitGetElementPtrInst(GetElementPtrInst &GEP); 225 Value *EmitGEPOffset(User *GEP);
|
InstCombineCasts.cpp | [all...] |
InstCombineCalls.cpp | 262 if (GEPOperator *GEP = dyn_cast<GEPOperator>(Op1)) { 263 if (!GEP->hasAllConstantIndices()) break; 267 SmallVector<Value*, 8> Ops(GEP->idx_begin(), GEP->idx_end()); 268 Offset = TD->getIndexedOffset(GEP->getPointerOperandType(), Ops); 270 Op1 = GEP->getPointerOperand()->stripPointerCasts(); [all...] |
/external/llvm/unittests/Transforms/Utils/ |
Cloning.cpp | 127 GetElementPtrInst *GEP = GetElementPtrInst::Create(V, ops); 128 EXPECT_FALSE(this->clone(GEP)->isInBounds()); 130 GEP->setIsInBounds(); 131 EXPECT_TRUE(this->clone(GEP)->isInBounds());
|
/external/llvm/lib/Transforms/IPO/ |
ArgumentPromotion.cpp | 73 /// A vector used to hold the indices of a single GEP instruction 318 // We can only promote this argument if all of the uses are loads, or are GEP 352 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) { 353 V = GEP->getPointerOperand(); 356 Indices.reserve(GEP->getNumIndices()); 357 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); 362 // We found a non-constant GEP index for this argument? Bail out 371 // Direct loads are equivalent to a GEP with a single 0 index. 377 // not (GEP+)loads, or any (GEP+)loads that are not safe to promote [all...] |
GlobalOpt.cpp | 239 // PHI nodes we can check just like select or GEP instructions, but we 342 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) { 343 // Do not transform "gepinst (gep constexpr (GV))" here, because forming 344 // "gepconstexpr (gep constexpr (GV))" will cause the two gep's to fold 347 if (!isa<ConstantExpr>(GEP->getOperand(0))) { 349 dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP)); 353 Changed |= CleanupConstantGlobalUsers(GEP, SubInit); 355 if (GEP->use_empty()) { 356 GEP->eraseFromParent() [all...] |
/external/llvm/lib/VMCore/ |
Value.cpp | 322 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 323 if (!GEP->hasAllZeroIndices()) 325 V = GEP->getPointerOperand(); 363 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(this)) { 365 if (!GEP->getOperand(0)->isDereferenceablePointer()) 368 gep_type_iterator GTI = gep_type_begin(GEP); 369 for (User::const_op_iterator I = GEP->op_begin()+1, 370 E = GEP->op_end(); I != E; ++I) {
|
Verifier.cpp | 279 void visitGetElementPtrInst(GetElementPtrInst &GEP); [all...] |
/external/llvm/lib/Transforms/Scalar/ |
GlobalMerge.cpp | 159 Constant *GEP = ConstantExpr::getInBoundsGetElementPtr(MergedGV, Idx); 160 Globals[k]->replaceAllUsesWith(GEP);
|
ScalarReplAggregates.cpp | 449 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) { 450 // If this is a GEP with a variable indices, we can't handle it. 451 if (!GEP->hasAllConstantIndices()) 454 // Compute the offset that this GEP adds to the pointer. 455 SmallVector<Value*, 8> Indices(GEP->op_begin()+1, GEP->op_end()); 456 uint64_t GEPOffset = TD.getIndexedOffset(GEP->getPointerOperandType(), 459 if (!CanConvertToScalar(GEP, Offset+GEPOffset)) 534 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) { 535 // Compute the offset that this GEP adds to the pointer [all...] |
MemCpyOptimizer.cpp | 41 static int64_t GetOffsetFromIndex(const GetElementPtrInst *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/Transforms/Utils/ |
CodeExtractor.cpp | 319 GetElementPtrInst *GEP = 321 RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI); 421 GetElementPtrInst *GEP = 424 codeReplacer->getInstList().push_back(GEP); 425 StoreInst *SI = new StoreInst(StructValues[i], GEP); 447 GetElementPtrInst *GEP 450 codeReplacer->getInstList().push_back(GEP); 451 Output = GEP; 562 GetElementPtrInst *GEP = 566 new StoreInst(outputs[out], GEP, NTRet) [all...] |
/external/llvm/lib/Analysis/IPA/ |
GlobalsModRef.cpp | 260 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) { 261 if (AnalyzeUsesOfPointer(GEP, Readers, Writers)) return true;
|