/frameworks/compile/libbcc/lib/Renderscript/ |
RSX86TranslateGEPPass.cpp | 43 // Walk a GEP instruction and return true if any type indexed is a struct. 44 bool GEPIndexesStructType(const llvm::GetElementPtrInst *GEP) { 45 for (llvm::gep_type_iterator GTI = gep_type_begin(GEP), 46 GTE = gep_type_end(GEP); 63 // Compute the byte offset for a GEP from the GEP's base pointer operand. 69 llvm::Value *computeGEPOffset(llvm::GetElementPtrInst *GEP) { 72 for (llvm::gep_type_iterator GTI = gep_type_begin(GEP), 73 GTE = gep_type_end(GEP); 87 Offset = incrementOffset(Offset, Incr, GEP); [all...] |
/external/llvm/lib/Transforms/Scalar/ |
NaryReassociate.cpp | 131 // Reassociate GEP for better CSE. 132 Instruction *tryReassociateGEP(GetElementPtrInst *GEP); 133 // Try splitting GEP at the I-th index and see whether either part can be 136 // \p IndexedType The element type indexed by GEP's I-th index. This is 138 // GEP->getIndexedType(GEP->getPointerOperand(), 0-th index, 140 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP, 142 // Given GEP's I-th index = LHS + RHS, see whether &Base[..][LHS][..] or 143 // &Base[..][RHS][..] can be CSE'ed and rewrite GEP accordingly. 144 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP, [all...] |
SeparateConstOffsetFromGEP.cpp | 25 // gep %a, 0, %x, %y; load 26 // gep %a, 0, %x, %y + 1; load 27 // gep %a, 0, %x + 1, %y; load 28 // gep %a, 0, %x + 1, %y + 1; load 31 // unable to reuse (gep %a, 0, %x, %y). As a result, this misoptimization incurs 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. 59 // base = gep a, 0, x, y 82 // Another improvement enabled by the LowerGEP flag is to lower a GEP with 103 // lower a GEP with multiple indices into arithmetic operations [all...] |
StraightLineStrengthReduce.cpp | 88 GEP, // &B[..][i * S][..] 100 // Note that Index and Stride of a GEP candidate do not necessarily have the 173 void allocateCandidatesAndFindBasisForGEP(GetElementPtrInst *GEP); 190 GetElementPtrInst *GEP); 192 // GEP and the bump is not divisible by the element size of the GEP, this 194 // basis using an ugly GEP. 238 static bool isGEPFoldable(GetElementPtrInst *GEP, 246 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getPointerOperand())) 251 gep_type_iterator GTI = gep_type_begin(GEP); [all...] |
LoadCombine.cpp | 94 if (auto *GEP = dyn_cast<GetElementPtrInst>(POP.Pointer)) { 96 unsigned BitWidth = DL.getPointerTypeSizeInBits(GEP->getType()); 98 if (GEP->accumulateConstantOffset(DL, Offset)) 103 POP.Pointer = GEP->getPointerOperand();
|
/external/llvm/include/llvm/IR/ |
GetElementPtrTypeIterator.h | 103 inline gep_type_iterator gep_type_begin(const User *GEP) { 104 auto *GEPOp = cast<GEPOperator>(GEP); 109 GEP->op_begin() + 1); 111 inline gep_type_iterator gep_type_end(const User *GEP) { 112 return gep_type_iterator::end(GEP->op_end()); 114 inline gep_type_iterator gep_type_begin(const User &GEP) { 115 auto &GEPOp = cast<GEPOperator>(GEP); 120 GEP.op_begin() + 1); 122 inline gep_type_iterator gep_type_end(const User &GEP) { 123 return gep_type_iterator::end(GEP.op_end()) [all...] |
/external/llvm/lib/Target/NVPTX/ |
NVPTXFavorNonGenericAddrSpaces.cpp | 14 // optimization also recursively traces into a GEP's pointer operand and a 21 // %1 = gep [10 x float]* %0, i64 0, i64 %i 25 // First, function hoistAddrSpaceCastFrom reorders the addrspacecast, the GEP, 29 // %0 = gep [10 x float] addrspace(3)* @a, i64 0, i64 %i 38 // %0 = gep [10 x float] addrspace(3)* @a, i64 0, i64 %i 91 /// Recursively traces into a GEP's pointer operand or a bitcast's source to 94 /// bitcast(gep(gep(addrspacecast(X)))) 96 /// addrspacecast(bitcast(gep(gep(X)))) [all...] |
NVVMReflect.cpp | 177 const ConstantExpr *GEP = cast<ConstantExpr>(Str); 179 const Value *Sym = GEP->getOperand(0);
|
/external/llvm/include/llvm/Transforms/Utils/ |
Local.h | 193 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &DL, User *GEP, 195 GEPOperator *GEPOp = cast<GEPOperator>(GEP); 196 Type *IntPtrTy = DL.getIntPtrType(GEP->getType()); 199 // If the GEP is inbounds, we know that none of the addressing operations will 207 gep_type_iterator GTI = gep_type_begin(GEP); 208 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; 226 GEP->getName()+".offs"); 234 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs"); 243 GEP->getName()+".idx", isInBounds /*NUW*/) [all...] |
/external/llvm/lib/Target/AMDGPU/ |
AMDGPUTargetTransformInfo.cpp | 42 const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(&I); 43 if (!GEP || GEP->getAddressSpace() != AMDGPUAS::PRIVATE_ADDRESS) 46 const Value *Ptr = GEP->getPointerOperand();
|
AMDGPUPromoteAlloca.cpp | 115 GetElementPtrInst *GEP = cast<GetElementPtrInst>(Ptr); 117 auto I = GEPIdx.find(GEP); 121 static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { 123 if (GEP->getNumOperands() != 3) 126 ConstantInt *I0 = dyn_cast<ConstantInt>(GEP->getOperand(1)); 130 return GEP->getOperand(2); 171 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(AllocaUser); 172 if (!GEP) { 180 Value *Index = GEPToVectorIndex(GEP); 182 // If we can't compute a vector index from this GEP, then we can' [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. 243 if (GEPI->getType() == GEP->getType() && 399 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) [all...] |
MemoryBuiltins.cpp | 417 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) 418 return visitGEPOperator(*GEP); 536 SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) { 537 SizeOffsetType PtrData = compute(GEP.getPointerOperand()); 539 if (!bothKnown(PtrData) || !GEP.accumulateConstantOffset(DL, Offset)) 651 } else if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 652 Result = visitGEPOperator(*GEP); 728 ObjectSizeOffsetEvaluator::visitGEPOperator(GEPOperator &GEP) { 729 SizeOffsetEvalType PtrData = compute_(GEP.getPointerOperand()); 733 Value *Offset = EmitGEPOffset(&Builder, DL, &GEP, /*NoAssumptions=*/true) [all...] |
VectorUtils.cpp | 228 /// \brief Find the operand of the GEP that should be checked for consecutive 231 unsigned llvm::getGEPInductionOperand(const GetElementPtrInst *Gep) { 232 const DataLayout &DL = Gep->getModule()->getDataLayout(); 233 unsigned LastOperand = Gep->getNumOperands() - 1; 235 cast<PointerType>(Gep->getType()->getScalarType())->getElementType()); 238 while (LastOperand > 1 && match(Gep->getOperand(LastOperand), m_Zero())) { 240 gep_type_iterator GEPTI = gep_type_begin(Gep); 243 // If it's a type with the same allocation size as the result of the GEP we 253 /// \brief If the argument is a GEP, then returns the operand identified by 257 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr) [all...] |
InlineCost.cpp | 109 bool isGEPOffsetConstant(GetElementPtrInst &GEP); 110 bool accumulateGEPOffset(GEPOperator &GEP, APInt &Offset); 247 /// \brief Check whether a GEP's indices are all constant. 250 bool CallAnalyzer::isGEPOffsetConstant(GetElementPtrInst &GEP) { 251 for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I) 258 /// \brief Accumulate a constant GEP offset into an APInt if possible. 262 bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) { 267 for (gep_type_iterator GTI = gep_type_begin(GEP), GTE = gep_type_end(GEP); [all...] |
/external/mesa3d/src/gallium/drivers/radeon/ |
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); 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->isInBounds()) [all...] |
/external/llvm/lib/Transforms/InstCombine/ |
InstructionCombining.cpp | 79 Value *InstCombiner::EmitGEPOffset(User *GEP) { 80 return llvm::EmitGEPOffset(Builder, DL, GEP); [all...] |
InstCombinePHI.cpp | 136 // This is true if all GEP bases are allocas and if all indices into them are 149 GetElementPtrInst *GEP= dyn_cast<GetElementPtrInst>(PN.getIncomingValue(i)); 150 if (!GEP || !GEP->hasOneUse() || GEP->getType() != FirstInst->getType() || 151 GEP->getNumOperands() != FirstInst->getNumOperands()) 154 AllInBounds &= GEP->isInBounds(); 158 (!isa<AllocaInst>(GEP->getOperand(0)) || 159 !GEP->hasAllConstantIndices())) 164 if (FirstInst->getOperand(op) == GEP->getOperand(op) [all...] |
InstCombineLoadStoreAlloca.cpp | 80 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { 81 // If the GEP has all zero indices, it doesn't offset the pointer. If it 84 std::make_pair(I, IsOffset || !GEP->hasAllZeroIndices())); 200 Instruction *GEP = 202 IC.InsertNewInstBefore(GEP, *It); 206 return IC.ReplaceInstUsesWith(AI, GEP); 659 // Then we know that we can replace %x in the GEP with i64 0. 661 // FIXME: We could fold any GEP index to zero that would cause UB if it were 670 // Find the first non-zero index of a GEP. If all indices are zero, return 721 // FIXME: If the GEP is not inbounds, and there are extra indices after th [all...] |
/external/llvm/lib/Transforms/IPO/ |
ArgumentPromotion.cpp | 81 /// A vector used to hold the indices of a single GEP instruction 440 // We can only promote this argument if all of the uses are loads, or are GEP 476 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) { 477 V = GEP->getPointerOperand(); 480 Indices.reserve(GEP->getNumIndices()); 481 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); 486 // We found a non-constant GEP index for this argument? Bail out 495 // Direct loads are equivalent to a GEP with a single 0 index. 501 // not (GEP+)loads, or any (GEP+)loads that are not safe to promote [all...] |
/external/llvm/lib/IR/ |
Value.cpp | 434 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 438 if (!GEP->hasAllZeroIndices()) 442 if (!GEP->hasAllConstantIndices()) 446 if (!GEP->isInBounds()) 450 V = GEP->getPointerOperand(); 495 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 496 if (!GEP->isInBounds()) 499 if (!GEP->accumulateConstantOffset(DL, GEPOffset)) 502 V = GEP->getPointerOperand();
|
/external/llvm/include/llvm/Analysis/ |
TargetTransformInfoImpl.h | 54 llvm_unreachable("Use getGEPCost for GEP operations!"); 419 // We assume that the cost of Scalar GEP with constant index and the 420 // cost of Vector GEP with splat constant index are the same. 439 assert(ConstIdx && "Unexpected GEP index"); 471 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(U)) { 472 SmallVector<Value *, 4> Indices(GEP->idx_begin(), GEP->idx_end()); 474 GEP->getSourceElementType(), GEP->getPointerOperand(), Indices);
|
MemoryBuiltins.h | 192 SizeOffsetType visitGEPOperator(GEPOperator &GEP); 257 SizeOffsetEvalType visitGEPOperator(GEPOperator &GEP);
|
/external/llvm/lib/Target/X86/ |
X86WinEHState.cpp | 387 if (auto *GEP = dyn_cast<GetElementPtrInst>(Link)) { 388 GEP = cast<GetElementPtrInst>(GEP->clone()); 389 Builder.Insert(GEP); 390 Link = GEP;
|
/external/llvm/lib/Transforms/Utils/ |
CodeExtractor.cpp | 368 GetElementPtrInst *GEP = GetElementPtrInst::Create( 370 RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI); 469 GetElementPtrInst *GEP = GetElementPtrInst::Create( 471 codeReplacer->getInstList().push_back(GEP); 472 StoreInst *SI = new StoreInst(StructValues[i], GEP); 494 GetElementPtrInst *GEP = GetElementPtrInst::Create( 496 codeReplacer->getInstList().push_back(GEP); 497 Output = GEP; 612 GetElementPtrInst *GEP = GetElementPtrInst::Create( 615 new StoreInst(outputs[out], GEP, NTRet) [all...] |