/external/llvm/include/llvm/Support/ |
D | GetElementPtrTypeIterator.h | 85 inline gep_type_iterator gep_type_begin(const User *GEP) { in gep_type_begin() argument 86 return gep_type_iterator::begin(GEP->getOperand(0)->getType(), in gep_type_begin() 87 GEP->op_begin()+1); in gep_type_begin() 89 inline gep_type_iterator gep_type_end(const User *GEP) { in gep_type_end() argument 90 return gep_type_iterator::end(GEP->op_end()); in gep_type_end() 92 inline gep_type_iterator gep_type_begin(const User &GEP) { in gep_type_begin() argument 93 return gep_type_iterator::begin(GEP.getOperand(0)->getType(), in gep_type_begin() 94 GEP.op_begin()+1); in gep_type_begin() 96 inline gep_type_iterator gep_type_end(const User &GEP) { in gep_type_end() argument 97 return gep_type_iterator::end(GEP.op_end()); in gep_type_end()
|
/external/llvm/lib/Transforms/InstCombine/ |
D | InstructionCombining.cpp | 742 Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { in visitGetElementPtrInst() argument 743 SmallVector<Value*, 8> Ops(GEP.op_begin(), GEP.op_end()); in visitGetElementPtrInst() 746 return ReplaceInstUsesWith(GEP, V); in visitGetElementPtrInst() 748 Value *PtrOp = GEP.getOperand(0); in visitGetElementPtrInst() 754 Type *IntPtrTy = TD->getIntPtrType(GEP.getContext()); in visitGetElementPtrInst() 756 gep_type_iterator GTI = gep_type_begin(GEP); in visitGetElementPtrInst() 757 for (User::op_iterator I = GEP.op_begin() + 1, E = GEP.op_end(); in visitGetElementPtrInst() 780 if (MadeChange) return &GEP; in visitGetElementPtrInst() 792 if (GEP.hasAllZeroIndices() && !Src->hasAllZeroIndices() && in visitGetElementPtrInst() 820 Value *GO1 = GEP.getOperand(1); in visitGetElementPtrInst() [all …]
|
D | InstCombineAddSub.cpp | 401 Value *InstCombiner::EmitGEPOffset(User *GEP) { in EmitGEPOffset() argument 403 gep_type_iterator GTI = gep_type_begin(GEP); in EmitGEPOffset() 404 Type *IntPtrTy = TD.getIntPtrType(GEP->getContext()); in EmitGEPOffset() 409 bool isInBounds = cast<GEPOperator>(GEP)->isInBounds(); in EmitGEPOffset() 415 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; in EmitGEPOffset() 428 GEP->getName()+".offs"); in EmitGEPOffset() 437 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs"); in EmitGEPOffset() 446 GEP->getName()+".idx", isInBounds /*NUW*/); in EmitGEPOffset() 450 Result = Builder->CreateAdd(Op, Result, GEP->getName()+".offs"); in EmitGEPOffset() 469 GetElementPtrInst *GEP = 0; in OptimizePointerDifference() local [all …]
|
D | InstCombinePHI.cpp | 148 GetElementPtrInst *GEP= dyn_cast<GetElementPtrInst>(PN.getIncomingValue(i)); in FoldPHIArgGEPIntoPHI() local 149 if (!GEP || !GEP->hasOneUse() || GEP->getType() != FirstInst->getType() || in FoldPHIArgGEPIntoPHI() 150 GEP->getNumOperands() != FirstInst->getNumOperands()) in FoldPHIArgGEPIntoPHI() 153 AllInBounds &= GEP->isInBounds(); in FoldPHIArgGEPIntoPHI() 157 (!isa<AllocaInst>(GEP->getOperand(0)) || in FoldPHIArgGEPIntoPHI() 158 !GEP->hasAllConstantIndices())) in FoldPHIArgGEPIntoPHI() 163 if (FirstInst->getOperand(op) == GEP->getOperand(op)) in FoldPHIArgGEPIntoPHI() 172 isa<ConstantInt>(GEP->getOperand(op))) in FoldPHIArgGEPIntoPHI() 175 if (FirstInst->getOperand(op)->getType() !=GEP->getOperand(op)->getType()) in FoldPHIArgGEPIntoPHI() 280 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(L->getOperand(0))) in isSafeAndProfitableToSinkLoad() local [all …]
|
D | InstCombineCompares.cpp | 200 FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, GlobalVariable *GV, in FoldCmpLoadFromIndexedGlobal() argument 203 if (!GEP->isInBounds() && TD == 0) return 0; in FoldCmpLoadFromIndexedGlobal() 212 if (GEP->getNumOperands() < 3 || in FoldCmpLoadFromIndexedGlobal() 213 !isa<ConstantInt>(GEP->getOperand(1)) || in FoldCmpLoadFromIndexedGlobal() 214 !cast<ConstantInt>(GEP->getOperand(1))->isZero() || in FoldCmpLoadFromIndexedGlobal() 215 isa<Constant>(GEP->getOperand(2))) in FoldCmpLoadFromIndexedGlobal() 224 for (unsigned i = 3, e = GEP->getNumOperands(); i != e; ++i) { in FoldCmpLoadFromIndexedGlobal() 225 ConstantInt *Idx = dyn_cast<ConstantInt>(GEP->getOperand(i)); in FoldCmpLoadFromIndexedGlobal() 359 Value *Idx = GEP->getOperand(2); in FoldCmpLoadFromIndexedGlobal() 364 if (!GEP->isInBounds() && in FoldCmpLoadFromIndexedGlobal() [all …]
|
D | InstCombineLoadStoreAlloca.cpp | 60 Instruction *GEP = in visitAllocaInst() local 63 InsertNewInstBefore(GEP, *It); in visitAllocaInst() 67 return ReplaceInstUsesWith(AI, GEP); in visitAllocaInst() 379 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) { in visitStoreInst() local 380 if (isa<AllocaInst>(GEP->getOperand(0))) { in visitStoreInst() 381 if (GEP->getOperand(0)->hasOneUse()) in visitStoreInst()
|
D | InstCombineCasts.cpp | 1330 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Src)) { in commonPointerCastTransforms() local 1333 if (GEP->hasAllZeroIndices()) { in commonPointerCastTransforms() 1337 Worklist.Add(GEP); in commonPointerCastTransforms() 1338 CI.setOperand(0, GEP->getOperand(0)); in commonPointerCastTransforms() 1346 if (TD && GEP->hasOneUse() && isa<BitCastInst>(GEP->getOperand(0)) && in commonPointerCastTransforms() 1347 GEP->hasAllConstantIndices()) { in commonPointerCastTransforms() 1349 ConstantInt *OffsetV = cast<ConstantInt>(EmitGEPOffset(GEP)); in commonPointerCastTransforms() 1353 Value *OrigBase = cast<BitCastInst>(GEP->getOperand(0))->getOperand(0); in commonPointerCastTransforms() 1361 Value *NGEP = cast<GEPOperator>(GEP)->isInBounds() ? in commonPointerCastTransforms() 1365 NGEP->takeName(GEP); in commonPointerCastTransforms()
|
D | InstCombine.h | 137 Instruction *FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, 183 Instruction *visitGetElementPtrInst(GetElementPtrInst &GEP); 222 Value *EmitGEPOffset(User *GEP);
|
/external/llvm/lib/Transforms/IPO/ |
D | ArgumentPromotion.cpp | 352 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) { in isSafeToPromoteArgument() local 353 V = GEP->getPointerOperand(); in isSafeToPromoteArgument() 356 Indices.reserve(GEP->getNumIndices()); in isSafeToPromoteArgument() 357 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); in isSafeToPromoteArgument() 389 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) { in isSafeToPromoteArgument() local 390 if (GEP->use_empty()) { in isSafeToPromoteArgument() 393 getAnalysis<AliasAnalysis>().deleteValue(GEP); in isSafeToPromoteArgument() 394 GEP->eraseFromParent(); in isSafeToPromoteArgument() 402 for (User::op_iterator i = GEP->idx_begin(), e = GEP->idx_end(); in isSafeToPromoteArgument() 410 for (Value::use_iterator UI = GEP->use_begin(), E = GEP->use_end(); in isSafeToPromoteArgument() [all …]
|
D | GlobalOpt.cpp | 340 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) { in CleanupConstantGlobalUsers() local 345 if (!isa<ConstantExpr>(GEP->getOperand(0))) { in CleanupConstantGlobalUsers() 347 dyn_cast_or_null<ConstantExpr>(ConstantFoldInstruction(GEP)); in CleanupConstantGlobalUsers() 351 Changed |= CleanupConstantGlobalUsers(GEP, SubInit); in CleanupConstantGlobalUsers() 353 if (GEP->use_empty()) { in CleanupConstantGlobalUsers() 354 GEP->eraseFromParent(); in CleanupConstantGlobalUsers() 579 User *GEP = GV->use_back(); in SRAGlobal() local 580 assert(((isa<ConstantExpr>(GEP) && in SRAGlobal() 581 cast<ConstantExpr>(GEP)->getOpcode()==Instruction::GetElementPtr)|| in SRAGlobal() 582 isa<GetElementPtrInst>(GEP)) && "NonGEP CE's are not SRAable!"); in SRAGlobal() [all …]
|
/external/llvm/lib/Analysis/ |
D | PHITransAddr.cpp | 216 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in PHITranslateSubExpr() local 219 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) { in PHITranslateSubExpr() 220 Value *GEPOp = PHITranslateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT); in PHITranslateSubExpr() 223 AnyChanged |= GEPOp != GEP->getOperand(i); in PHITranslateSubExpr() 228 return GEP; in PHITranslateSubExpr() 243 if (GEPI->getType() == GEP->getType() && in PHITranslateSubExpr() 399 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in InsertPHITranslatedSubExpr() local 401 BasicBlock *CurBB = GEP->getParent(); in InsertPHITranslatedSubExpr() 402 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) { in InsertPHITranslatedSubExpr() 403 Value *OpVal = InsertPHITranslatedSubExpr(GEP->getOperand(i), in InsertPHITranslatedSubExpr() [all …]
|
D | Loads.cpp | 61 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { in getUnderlyingObjectWithOffset() local 62 if (!GEP->hasAllConstantIndices()) in getUnderlyingObjectWithOffset() 64 SmallVector<Value*, 8> Indices(GEP->op_begin() + 1, GEP->op_end()); in getUnderlyingObjectWithOffset() 65 ByteOffset += TD->getIndexedOffset(GEP->getPointerOperandType(), in getUnderlyingObjectWithOffset() 67 V = GEP->getPointerOperand(); in getUnderlyingObjectWithOffset()
|
D | ValueTracking.cpp | 1496 GEPOperator *GEP = dyn_cast<GEPOperator>(PtrOp); in GetPointerBaseWithConstantOffset() local 1497 if (GEP == 0 || !GEP->hasAllConstantIndices()) return Ptr; in GetPointerBaseWithConstantOffset() 1499 gep_type_iterator GTI = gep_type_begin(GEP); in GetPointerBaseWithConstantOffset() 1500 for (User::op_iterator I = GEP->idx_begin(), E = GEP->idx_end(); I != E; in GetPointerBaseWithConstantOffset() 1520 return GetPointerBaseWithConstantOffset(GEP->getPointerOperand(), Offset, TD); in GetPointerBaseWithConstantOffset() 1540 const User *GEP = 0; in GetConstantStringInfo() local 1542 GEP = GEPI; in GetConstantStringInfo() 1548 GEP = CE; in GetConstantStringInfo() 1551 if (GEP) { in GetConstantStringInfo() 1553 if (GEP->getNumOperands() != 3) in GetConstantStringInfo() [all …]
|
D | InlineCost.cpp | 201 else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { in CountCodeReductionForAlloca() local 203 if (GEP->hasAllConstantIndices()) in CountCodeReductionForAlloca() 204 Reduction += CountCodeReductionForAlloca(GEP); in CountCodeReductionForAlloca()
|
/external/llvm/unittests/Transforms/Utils/ |
D | Cloning.cpp | 127 GetElementPtrInst *GEP = GetElementPtrInst::Create(V, ops.begin(), ops.end()); in TEST_F() local 128 EXPECT_FALSE(this->clone(GEP)->isInBounds()); in TEST_F() 130 GEP->setIsInBounds(); in TEST_F() 131 EXPECT_TRUE(this->clone(GEP)->isInBounds()); in TEST_F()
|
/external/llvm/lib/VMCore/ |
D | Value.cpp | 322 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { in stripPointerCasts() local 323 if (!GEP->hasAllZeroIndices()) in stripPointerCasts() 325 V = GEP->getPointerOperand(); in stripPointerCasts() 363 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(this)) { in isDereferenceablePointer() local 365 if (!GEP->getOperand(0)->isDereferenceablePointer()) in isDereferenceablePointer() 368 gep_type_iterator GTI = gep_type_begin(GEP); in isDereferenceablePointer() 369 for (User::const_op_iterator I = GEP->op_begin()+1, in isDereferenceablePointer() 370 E = GEP->op_end(); I != E; ++I) { in isDereferenceablePointer()
|
D | Verifier.cpp | 268 void visitGetElementPtrInst(GetElementPtrInst &GEP); 1276 void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) { in visitGetElementPtrInst() argument 1277 SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end()); in visitGetElementPtrInst() 1279 GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(), in visitGetElementPtrInst() 1281 Assert1(ElTy, "Invalid indices for GEP pointer type!", &GEP); in visitGetElementPtrInst() 1282 Assert2(GEP.getType()->isPointerTy() && in visitGetElementPtrInst() 1283 cast<PointerType>(GEP.getType())->getElementType() == ElTy, in visitGetElementPtrInst() 1284 "GEP is not of right type for indices!", &GEP, ElTy); in visitGetElementPtrInst() 1285 visitInstruction(GEP); in visitGetElementPtrInst()
|
/external/llvm/test/Analysis/BasicAA/ |
D | 2009-10-13-GEP-BaseNoAlias.ll | 2 ; If GEP base doesn't alias Z, then GEP doesn't alias Z.
|
/external/llvm/lib/Transforms/Utils/ |
D | CodeExtractor.cpp | 319 GetElementPtrInst *GEP = in constructFunction() local 322 RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI); in constructFunction() 422 GetElementPtrInst *GEP = in emitCallAndSwitchStatement() local 425 codeReplacer->getInstList().push_back(GEP); in emitCallAndSwitchStatement() 426 StoreInst *SI = new StoreInst(StructValues[i], GEP); in emitCallAndSwitchStatement() 448 GetElementPtrInst *GEP in emitCallAndSwitchStatement() local 451 codeReplacer->getInstList().push_back(GEP); in emitCallAndSwitchStatement() 452 Output = GEP; in emitCallAndSwitchStatement() 563 GetElementPtrInst *GEP = in emitCallAndSwitchStatement() local 567 new StoreInst(outputs[out], GEP, NTRet); in emitCallAndSwitchStatement()
|
/external/llvm/test/Transforms/InstCombine/ |
D | extractvalue.ll | 43 ; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* %pair, i32 0, i32 1 44 ; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32* [[GEP]] 71 ; CHECK-NEXT: [[GEP:%[a-z0-9]+]] = getelementptr inbounds {{.*}}* %arg, i32 0, i32 1, i32 1 72 ; CHECK-NEXT: [[LOAD:%[A-Za-z0-9]+]] = load i32* [[GEP]]
|
/external/llvm/test/Transforms/ScalarRepl/ |
D | nonzero-first-index.ll | 8 ; Check that a GEP with a non-zero first index does not prevent SROA as long 32 ; Try it with a bitcast and single GEP....
|
/external/llvm/lib/Target/ARM/ |
D | ARMGlobalMerge.cpp | 153 Constant *GEP = ConstantExpr::getInBoundsGetElementPtr(MergedGV, Idx, 2); in doMerge() local 154 Globals[k]->replaceAllUsesWith(GEP); in doMerge()
|
/external/llvm/test/Transforms/GlobalOpt/ |
D | deadglobal-2.ll | 3 ; This is a harder case to delete as the GEP has a variable index.
|
/external/llvm/lib/Transforms/Scalar/ |
D | ScalarReplAggregates.cpp | 511 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) { in CanConvertToScalar() local 513 if (!GEP->hasAllConstantIndices()) in CanConvertToScalar() 517 SmallVector<Value*, 8> Indices(GEP->op_begin()+1, GEP->op_end()); in CanConvertToScalar() 518 uint64_t GEPOffset = TD.getIndexedOffset(GEP->getPointerOperandType(), in CanConvertToScalar() 521 if (!CanConvertToScalar(GEP, Offset+GEPOffset)) in CanConvertToScalar() 588 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(User)) { in ConvertUsesToScalar() local 590 SmallVector<Value*, 8> Indices(GEP->op_begin()+1, GEP->op_end()); in ConvertUsesToScalar() 591 uint64_t GEPOffset = TD.getIndexedOffset(GEP->getPointerOperandType(), in ConvertUsesToScalar() 593 ConvertUsesToScalar(GEP, NewAI, Offset+GEPOffset*8); in ConvertUsesToScalar() 594 GEP->eraseFromParent(); in ConvertUsesToScalar() [all …]
|
/external/llvm/test/CodeGen/X86/ |
D | fast-isel-gep.ll | 5 ; GEP indices are interpreted as signed integers, so they 75 ; PR8961 - Make sure the sext for the GEP addressing comes before the load that
|