/external/llvm/lib/Target/NVPTX/ |
H A D | NVPTXFavorNonGenericAddrSpaces.cpp | 14 // the base pointer of a GEP. 24 // and the GEP to expose more optimization opportunities to function 75 bool hoistAddrSpaceCastFromGEP(GEPOperator *GEP); 112 GEPOperator *GEP) { 113 Operator *Cast = dyn_cast<Operator>(GEP->getPointerOperand()); 120 SmallVector<Value *, 8> Indices(GEP->idx_begin(), GEP->idx_end()); 121 if (Instruction *GEPI = dyn_cast<Instruction>(GEP)) { 128 GEP->getName(), 130 NewGEPI->setIsInBounds(GEP 111 hoistAddrSpaceCastFromGEP( GEPOperator *GEP) argument [all...] |
H A D | NVVMReflect.cpp | 156 const ConstantExpr *GEP = cast<ConstantExpr>(Str); local 158 const Value *Sym = GEP->getOperand(0);
|
/external/llvm/lib/Transforms/Scalar/ |
H A D | SeparateConstOffsetFromGEP.cpp | 35 // each GEP, wasting tons of registers. It emits the following PTX for the 51 // It works by splitting each GEP into a variadic base and a constant offset. 100 cl::desc("Do not separate the constant offset from a GEP instruction"), 105 /// \brief A helper class for separating a constant offset from a GEP index. 107 /// In real programs, a GEP index may be more complicated than a simple addition 112 /// Therefore, this class looks into the expression that computes a given GEP 120 /// Extracts a constant offset from the given GEP index. It outputs the 124 /// \p Idx The given GEP index 127 /// \p GEP The given GEP 557 Extract(Value *Idx, Value *&NewIdx, const DataLayout *DL, GetElementPtrInst *GEP) argument 572 Find(Value *Idx, const DataLayout *DL, GetElementPtrInst *GEP) argument 598 canonicalizeArrayIndicesToPointerSize( GetElementPtrInst *GEP) argument 617 convertInBoundsZExtToSExt(GetElementPtrInst *GEP) argument 654 accumulateByteOffset(GetElementPtrInst *GEP, bool &NeedsExtraction) argument 677 splitGEP(GetElementPtrInst *GEP) argument [all...] |
H A D | LoadCombine.cpp | 97 if (auto *GEP = dyn_cast<GetElementPtrInst>(POP.Pointer)) { 98 unsigned BitWidth = DL->getPointerTypeSizeInBits(GEP->getType()); 100 if (GEP->accumulateConstantOffset(*DL, Offset)) 105 POP.Pointer = GEP->getPointerOperand();
|
/external/llvm/include/llvm/IR/ |
H A D | GetElementPtrTypeIterator.h | 85 inline gep_type_iterator gep_type_begin(const User *GEP) { argument 87 (GEP->getOperand(0)->getType()->getScalarType(), 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 94 (GEP.getOperand(0)->getType()->getScalarType(), 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 | 187 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &TD, User *GEP, argument 189 GEPOperator *GEPOp = cast<GEPOperator>(GEP); 190 Type *IntPtrTy = TD.getIntPtrType(GEP->getType()); 193 // If the GEP is inbounds, we know that none of the addressing operations will 201 gep_type_iterator GTI = gep_type_begin(GEP); 202 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; 220 GEP->getName()+".offs"); 228 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs"); 237 GEP [all...] |
/external/llvm/lib/Target/R600/ |
H A D | AMDGPUTargetTransformInfo.cpp | 103 const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I); local 104 if (!GEP) 106 const Value *Ptr = GEP->getPointerOperand();
|
H A D | AMDGPUPromoteAlloca.cpp | 115 GetElementPtrInst *GEP = cast<GetElementPtrInst>(Ptr); 117 return GEPIdx[GEP]; 120 static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { argument 122 if (GEP->getNumOperands() != 3) 125 ConstantInt *I0 = dyn_cast<ConstantInt>(GEP->getOperand(1)); 129 return GEP->getOperand(2); 166 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(AllocaUser); local 167 if (!GEP) { 175 Value *Index = GEPToVectorIndex(GEP); 177 // If we can't compute a vector index from this GEP, the [all...] |
/external/llvm/lib/Transforms/InstCombine/ |
H A D | InstructionCombining.cpp | 98 Value *InstCombiner::EmitGEPOffset(User *GEP) { argument 99 return llvm::EmitGEPOffset(Builder, *getDataLayout(), GEP); 862 /// whether or not there is a sequence of GEP indices into the pointed type that 928 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { argument 929 // If this GEP has only 0 indices, it is the same pointer as 930 // Src. If Src is not a trivial GEP too, don't combine 932 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && 1284 Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { argument 1285 SmallVector<Value*, 8> Ops(GEP.op_begin(), GEP 2136 Value *GEP = Builder->CreateInBoundsGEP(L->getPointerOperand(), Indices); local [all...] |
H A D | InstCombinePHI.cpp | 137 // This is true if all GEP bases are allocas and if all indices into them are 150 GetElementPtrInst *GEP= dyn_cast<GetElementPtrInst>(PN.getIncomingValue(i)); local 151 if (!GEP || !GEP->hasOneUse() || GEP->getType() != FirstInst->getType() || 152 GEP->getNumOperands() != FirstInst->getNumOperands()) 155 AllInBounds &= GEP->isInBounds(); 159 (!isa<AllocaInst>(GEP->getOperand(0)) || 160 !GEP->hasAllConstantIndices())) 165 if (FirstInst->getOperand(op) == GEP [all...] |
H A D | InstCombineLoadStoreAlloca.cpp | 77 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { 78 // If the GEP has all zero indices, it doesn't offset the pointer. If it 81 std::make_pair(I, IsOffset || !GEP->hasAllZeroIndices())); 200 Instruction *GEP = local 202 InsertNewInstBefore(GEP, *It); 206 return ReplaceInstUsesWith(AI, GEP); 556 // emit a GEP to index into its first field. 625 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) { 626 if (isa<AllocaInst>(GEP->getOperand(0))) { 627 if (GEP [all...] |
H A D | InstCombineCompares.cpp | 220 FoldCmpLoadFromIndexedGlobal(GetElementPtrInst *GEP, GlobalVariable *GV, argument 223 if (!GEP->isInBounds() && !DL) 236 // Require: GEP GV, 0, i {{, constant indices}} 237 if (GEP->getNumOperands() < 3 || 238 !isa<ConstantInt>(GEP->getOperand(1)) || 239 !cast<ConstantInt>(GEP->getOperand(1))->isZero() || 240 isa<Constant>(GEP->getOperand(2))) 249 for (unsigned i = 3, e = GEP->getNumOperands(); i != e; ++i) { 250 ConstantInt *Idx = dyn_cast<ConstantInt>(GEP->getOperand(i)); 385 Value *Idx = GEP 507 EvaluateGEPOffsetExpression(User *GEP, InstCombiner &IC) argument [all...] |
/external/chromium_org/third_party/mesa/src/src/gallium/drivers/radeon/ |
H A D | R600KernelParameters.cpp | 159 getElementPtrInst* GEP = dyn_cast<getElementPtrInst>(Val); 160 getElementPtrInst::op_iterator I = GEP->op_begin(); 162 for (++I; I != GEP->op_end(); ++I) { 247 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V); local 257 if (GEP && GEP->getType()->getAddressSpace() != Addrspace) { 258 Value *Op = GEP->getPointerOperand(); 266 std::vector<Value*> Params(GEP->idx_begin(), GEP->idx_end()); 270 GEP2->setIsInBounds(GEP [all...] |
/external/mesa3d/src/gallium/drivers/radeon/ |
H A D | R600KernelParameters.cpp | 159 getElementPtrInst* GEP = dyn_cast<getElementPtrInst>(Val); 160 getElementPtrInst::op_iterator I = GEP->op_begin(); 162 for (++I; I != GEP->op_end(); ++I) { 247 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V); local 257 if (GEP && GEP->getType()->getAddressSpace() != Addrspace) { 258 Value *Op = GEP->getPointerOperand(); 266 std::vector<Value*> Params(GEP->idx_begin(), GEP->idx_end()); 270 GEP2->setIsInBounds(GEP [all...] |
/external/llvm/lib/Analysis/ |
H A D | 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. 242 if (GEPI->getType() == GEP->getType() && 397 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { 399 BasicBlock *CurBB = GEP [all...] |
H A D | MemoryBuiltins.cpp | 418 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) 419 return visitGEPOperator(*GEP); 537 SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) { argument 538 SizeOffsetType PtrData = compute(GEP.getPointerOperand()); 540 if (!bothKnown(PtrData) || !GEP.accumulateConstantOffset(*DL, Offset)) 653 } else if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 654 Result = visitGEPOperator(*GEP); 733 ObjectSizeOffsetEvaluator::visitGEPOperator(GEPOperator &GEP) { argument 734 SizeOffsetEvalType PtrData = compute_(GEP.getPointerOperand()); 738 Value *Offset = EmitGEPOffset(&Builder, *DL, &GEP, /*NoAssumption [all...] |
H A D | ValueTracking.cpp | 909 /// \brief Test whether a GEP's result is known to be non-null. 911 /// Uses properties inherent in a GEP to try to determine whether it is known 915 static bool isGEPKnownNonNull(GEPOperator *GEP, const DataLayout *DL, argument 917 if (!GEP->isInBounds() || GEP->getPointerAddressSpace() != 0) 921 assert(GEP->getType()->isPointerTy() && "We only support plain pointer GEP"); 924 // inbounds GEP in address space zero. 925 if (isKnownNonZero(GEP->getPointerOperand(), DL, Depth)) 932 // Walk the GEP operand [all...] |
/external/llvm/lib/IR/ |
H A D | Value.cpp | 388 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 392 if (!GEP->hasAllZeroIndices()) 396 if (!GEP->hasAllConstantIndices()) 400 if (!GEP->isInBounds()) 404 V = GEP->getPointerOperand(); 449 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 450 if (!GEP->isInBounds()) 453 if (!GEP->accumulateConstantOffset(DL, GEPOffset)) 456 V = GEP->getPointerOperand(); 512 if (const GEPOperator *GEP [all...] |
/external/llvm/lib/Transforms/IPO/ |
H A D | ArgumentPromotion.cpp | 76 /// A vector used to hold the indices of a single GEP instruction 321 // We can only promote this argument if all of the uses are loads, or are GEP 358 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) { 359 V = GEP->getPointerOperand(); 362 Indices.reserve(GEP->getNumIndices()); 363 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); 368 // We found a non-constant GEP index for this argument? Bail out 377 // Direct loads are equivalent to a GEP with a single 0 index. 383 // not (GEP 858 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->user_back()); local [all...] |
/external/llvm/lib/CodeGen/ |
H A D | GlobalMerge.cpp | 222 Constant *GEP = ConstantExpr::getInBoundsGetElementPtr(MergedGV, Idx); local 223 Globals[k]->replaceAllUsesWith(GEP); 228 auto *PTy = cast<PointerType>(GEP->getType()); 230 Linkage, Name, GEP, &M);
|
/external/llvm/lib/Transforms/Utils/ |
H A D | CodeExtractor.cpp | 367 GetElementPtrInst *GEP = local 369 RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI); 468 GetElementPtrInst *GEP = local 471 codeReplacer->getInstList().push_back(GEP); 472 StoreInst *SI = new StoreInst(StructValues[i], GEP); 494 GetElementPtrInst *GEP local 497 codeReplacer->getInstList().push_back(GEP); 498 Output = GEP; 609 GetElementPtrInst *GEP = local 613 new StoreInst(outputs[out], GEP, NTRe [all...] |
/external/llvm/lib/Analysis/IPA/ |
H A D | InlineCost.cpp | 101 bool isGEPOffsetConstant(GetElementPtrInst &GEP); 102 bool accumulateGEPOffset(GEPOperator &GEP, APInt &Offset); 226 /// \brief Check whether a GEP's indices are all constant. 229 bool CallAnalyzer::isGEPOffsetConstant(GetElementPtrInst &GEP) { argument 230 for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I) 237 /// \brief Accumulate a constant GEP offset into an APInt if possible. 241 bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) { argument 248 for (gep_type_iterator GTI = gep_type_begin(GEP), GTE = gep_type_end(GEP); [all...] |
/external/llvm/unittests/Transforms/Utils/ |
H A D | Cloning.cpp | 139 GetElementPtrInst *GEP = GetElementPtrInst::Create(V, ops); local 140 EXPECT_FALSE(this->clone(GEP)->isInBounds()); 142 GEP->setIsInBounds(); 143 EXPECT_TRUE(this->clone(GEP)->isInBounds());
|
/external/llvm/include/llvm/Analysis/ |
H A D | MemoryBuiltins.h | 201 SizeOffsetType visitGEPOperator(GEPOperator &GEP); 266 SizeOffsetEvalType visitGEPOperator(GEPOperator &GEP);
|
/external/llvm/unittests/Linker/ |
H A D | LinkModulesTest.cpp | 76 Value *GEP = Builder.CreateGEP(GV, GEPIndices, "switch.gep"); local 77 Value *Load = Builder.CreateLoad(GEP, "switch.load");
|