Home
last modified time | relevance | path

Searched refs:GEP (Results 1 – 25 of 113) sorted by relevance

12345

/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/Scalar/
DSeparateConstOffsetFromGEP.cpp237 static Value *Extract(Value *Idx, GetElementPtrInst *GEP,
243 static int64_t Find(Value *Idx, GetElementPtrInst *GEP,
373 bool splitGEP(GetElementPtrInst *GEP);
400 int64_t accumulateByteOffset(GetElementPtrInst *GEP, bool &NeedsExtraction);
417 bool canonicalizeArrayIndicesToPointerSize(GetElementPtrInst *GEP);
736 Value *ConstantOffsetExtractor::Extract(Value *Idx, GetElementPtrInst *GEP, in Extract() argument
739 ConstantOffsetExtractor Extractor(GEP, DT); in Extract()
743 GEP->isInBounds()); in Extract()
754 int64_t ConstantOffsetExtractor::Find(Value *Idx, GetElementPtrInst *GEP, in Find() argument
757 return ConstantOffsetExtractor(GEP, DT) in Find()
[all …]
DNaryReassociate.cpp298 static bool isGEPFoldable(GetElementPtrInst *GEP, in isGEPFoldable() argument
301 for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I) in isGEPFoldable()
303 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), in isGEPFoldable()
307 Instruction *NaryReassociatePass::tryReassociateGEP(GetElementPtrInst *GEP) { in tryReassociateGEP() argument
309 if (isGEPFoldable(GEP, TTI)) in tryReassociateGEP()
312 gep_type_iterator GTI = gep_type_begin(*GEP); in tryReassociateGEP()
313 for (unsigned I = 1, E = GEP->getNumOperands(); I != E; ++I, ++GTI) { in tryReassociateGEP()
315 if (auto *NewGEP = tryReassociateGEPAtIndex(GEP, I - 1, in tryReassociateGEP()
325 GetElementPtrInst *GEP) { in requiresSignExtension() argument
327 DL->getPointerSizeInBits(GEP->getType()->getPointerAddressSpace()); in requiresSignExtension()
[all …]
DStraightLineStrengthReduce.cpp107 GEP, // &B[..][i * S][..] enumerator
201 void allocateCandidatesAndFindBasisForGEP(GetElementPtrInst *GEP);
222 GetElementPtrInst *GEP);
273 static bool isGEPFoldable(GetElementPtrInst *GEP, in isGEPFoldable() argument
276 for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I) in isGEPFoldable()
278 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), in isGEPFoldable()
296 if (C.CandidateKind == Candidate::GEP) in isFoldable()
302 static bool hasOnlyOneNonZeroIndex(GetElementPtrInst *GEP) { in hasOnlyOneNonZeroIndex() argument
304 for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I) { in hasOnlyOneNonZeroIndex()
321 if (C.CandidateKind == Candidate::GEP) { in isSimplestForm()
[all …]
DMergeICmps.cpp83 BCEAtom(GetElementPtrInst *GEP, LoadInst *LoadI, int BaseId, APInt Offset) in BCEAtom()
84 : GEP(GEP), LoadI(LoadI), BaseId(BaseId), Offset(Offset) {} in BCEAtom()
93 GEP = that.GEP; in operator =()
114 GetElementPtrInst *GEP = nullptr; member
157 auto *const GEP = dyn_cast<GetElementPtrInst>(Addr); in visitICmpLoadOperand() local
158 if (!GEP) in visitICmpLoadOperand()
161 if (GEP->isUsedOutsideOfBlock(LoadI->getParent())) { in visitICmpLoadOperand()
165 const auto &DL = GEP->getModule()->getDataLayout(); in visitICmpLoadOperand()
166 if (!isDereferenceablePointer(GEP, LoadI->getType(), DL)) { in visitICmpLoadOperand()
172 APInt Offset = APInt(DL.getPointerTypeSizeInBits(GEP->getType()), 0); in visitICmpLoadOperand()
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/IPO/
DGlobalSplit.cpp60 auto *GEP = dyn_cast<GEPOperator>(U); in splitGlobal() local
61 if (!GEP || !GEP->getInRangeIndex() || *GEP->getInRangeIndex() != 1 || in splitGlobal()
62 !isa<ConstantInt>(GEP->getOperand(1)) || in splitGlobal()
63 !cast<ConstantInt>(GEP->getOperand(1))->isZero() || in splitGlobal()
64 !isa<ConstantInt>(GEP->getOperand(2))) in splitGlobal()
117 auto *GEP = cast<GEPOperator>(U); in splitGlobal() local
118 unsigned I = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue(); in splitGlobal()
124 for (unsigned I = 3; I != GEP->getNumOperands(); ++I) in splitGlobal()
125 Ops.push_back(GEP->getOperand(I)); in splitGlobal()
129 GEP->isInBounds()); in splitGlobal()
[all …]
DArgumentPromotion.cpp439 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->user_back()); in doPromotion() local
441 Operands.reserve(GEP->getNumIndices()); in doPromotion()
442 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); in doPromotion()
468 while (!GEP->use_empty()) { in doPromotion()
469 LoadInst *L = cast<LoadInst>(GEP->user_back()); in doPromotion()
473 GEP->eraseFromParent(); in doPromotion()
631 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(V)) { in isSafeToPromoteArgument() local
632 V = GEP->getPointerOperand(); in isSafeToPromoteArgument()
635 Indices.reserve(GEP->getNumIndices()); in isSafeToPromoteArgument()
636 for (User::op_iterator II = GEP->idx_begin(), IE = GEP->idx_end(); in isSafeToPromoteArgument()
[all …]
DGlobalOpt.cpp175 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { in IsSafeComputationToRemove() local
176 if (!GEP->hasAllConstantIndices()) in IsSafeComputationToRemove()
320 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) { in CleanupConstantGlobalUsers() local
325 if (!isa<ConstantExpr>(GEP->getOperand(0))) { in CleanupConstantGlobalUsers()
327 ConstantFoldInstruction(GEP, DL, &GetTLI(*GEP->getFunction()))); in CleanupConstantGlobalUsers()
334 if (Init && isa<ConstantAggregateZero>(Init) && GEP->isInBounds()) in CleanupConstantGlobalUsers()
335 SubInit = Constant::getNullValue(GEP->getResultElementType()); in CleanupConstantGlobalUsers()
337 Changed |= CleanupConstantGlobalUsers(GEP, SubInit, DL, GetTLI); in CleanupConstantGlobalUsers()
339 if (GEP->use_empty()) { in CleanupConstantGlobalUsers()
340 GEP->eraseFromParent(); in CleanupConstantGlobalUsers()
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Analysis/Utils/
DLocal.h29 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &DL, User *GEP,
31 GEPOperator *GEPOp = cast<GEPOperator>(GEP);
32 Type *IntIdxTy = DL.getIndexType(GEP->getType());
44 gep_type_iterator GTI = gep_type_begin(GEP);
45 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;
60 GEP->getName()+".offs");
73 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs");
87 GEP->getName() + ".idx", false /*NUW*/,
92 Result = Builder->CreateAdd(Op, Result, GEP->getName()+".offs");
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/include/llvm/IR/
DGetElementPtrTypeIterator.h127 inline gep_type_iterator gep_type_begin(const User *GEP) { in gep_type_begin() argument
128 auto *GEPOp = cast<GEPOperator>(GEP); in gep_type_begin()
131 GEP->op_begin() + 1); in gep_type_begin()
134 inline gep_type_iterator gep_type_end(const User *GEP) { in gep_type_end() argument
135 return gep_type_iterator::end(GEP->op_end()); in gep_type_end()
138 inline gep_type_iterator gep_type_begin(const User &GEP) { in gep_type_begin() argument
139 auto &GEPOp = cast<GEPOperator>(GEP); in gep_type_begin()
142 GEP.op_begin() + 1); in gep_type_begin()
145 inline gep_type_iterator gep_type_end(const User &GEP) { in gep_type_end() argument
146 return gep_type_iterator::end(GEP.op_end()); in gep_type_end()
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/InstCombine/
DInstructionCombining.cpp161 Value *InstCombiner::EmitGEPOffset(User *GEP) { in EmitGEPOffset() argument
162 return llvm::EmitGEPOffset(&Builder, DL, GEP); in EmitGEPOffset()
1182 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { in shouldMergeGEPs() argument
1186 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && in shouldMergeGEPs()
1661 Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { in visitGetElementPtrInst() argument
1662 SmallVector<Value*, 8> Ops(GEP.op_begin(), GEP.op_end()); in visitGetElementPtrInst()
1663 Type *GEPType = GEP.getType(); in visitGetElementPtrInst()
1664 Type *GEPEltType = GEP.getSourceElementType(); in visitGetElementPtrInst()
1665 if (Value *V = SimplifyGEPInst(GEPEltType, Ops, SQ.getWithInstruction(&GEP))) in visitGetElementPtrInst()
1666 return replaceInstUsesWith(GEP, V); in visitGetElementPtrInst()
[all …]
DInstCombinePHI.cpp406 GetElementPtrInst *GEP= dyn_cast<GetElementPtrInst>(PN.getIncomingValue(i)); in FoldPHIArgGEPIntoPHI() local
407 if (!GEP || !GEP->hasOneUse() || GEP->getType() != FirstInst->getType() || in FoldPHIArgGEPIntoPHI()
408 GEP->getNumOperands() != FirstInst->getNumOperands()) in FoldPHIArgGEPIntoPHI()
411 AllInBounds &= GEP->isInBounds(); in FoldPHIArgGEPIntoPHI()
415 (!isa<AllocaInst>(GEP->getOperand(0)) || in FoldPHIArgGEPIntoPHI()
416 !GEP->hasAllConstantIndices())) in FoldPHIArgGEPIntoPHI()
421 if (FirstInst->getOperand(op) == GEP->getOperand(op)) in FoldPHIArgGEPIntoPHI()
430 isa<ConstantInt>(GEP->getOperand(op))) in FoldPHIArgGEPIntoPHI()
433 if (FirstInst->getOperand(op)->getType() !=GEP->getOperand(op)->getType()) in FoldPHIArgGEPIntoPHI()
535 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(L->getOperand(0))) in isSafeAndProfitableToSinkLoad() local
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Analysis/
DPHITransAddr.cpp214 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in PHITranslateSubExpr() local
217 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) { in PHITranslateSubExpr()
218 Value *GEPOp = PHITranslateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT); in PHITranslateSubExpr()
221 AnyChanged |= GEPOp != GEP->getOperand(i); in PHITranslateSubExpr()
226 return GEP; in PHITranslateSubExpr()
229 if (Value *V = SimplifyGEPInst(GEP->getSourceElementType(), in PHITranslateSubExpr()
241 if (GEPI->getType() == GEP->getType() && in PHITranslateSubExpr()
396 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in InsertPHITranslatedSubExpr() local
398 BasicBlock *CurBB = GEP->getParent(); in InsertPHITranslatedSubExpr()
399 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) { in InsertPHITranslatedSubExpr()
[all …]
DTypeMetadataUtils.cpp60 } else if (auto GEP = dyn_cast<GetElementPtrInst>(User)) { in findLoadCallsAtConstantOffset() local
62 if (VPtr == GEP->getPointerOperand() && GEP->hasAllConstantIndices()) { in findLoadCallsAtConstantOffset()
63 SmallVector<Value *, 8> Indices(GEP->op_begin() + 1, GEP->op_end()); in findLoadCallsAtConstantOffset()
65 GEP->getSourceElementType(), Indices); in findLoadCallsAtConstantOffset()
DInlineCost.cpp273 bool isGEPFree(GetElementPtrInst &GEP);
275 bool accumulateGEPOffset(GEPOperator &GEP, APInt &Offset);
674 bool CallAnalyzer::accumulateGEPOffset(GEPOperator &GEP, APInt &Offset) { in accumulateGEPOffset() argument
675 unsigned IntPtrWidth = DL.getIndexTypeSizeInBits(GEP.getType()); in accumulateGEPOffset()
678 for (gep_type_iterator GTI = gep_type_begin(GEP), GTE = gep_type_end(GEP); in accumulateGEPOffset()
706 bool CallAnalyzer::isGEPFree(GetElementPtrInst &GEP) { in isGEPFree() argument
708 Operands.push_back(GEP.getOperand(0)); in isGEPFree()
709 for (User::op_iterator I = GEP.idx_begin(), E = GEP.idx_end(); I != E; ++I) in isGEPFree()
714 return TargetTransformInfo::TCC_Free == TTI.getUserCost(&GEP, Operands); in isGEPFree()
870 auto IsGEPOffsetConstant = [&](GetElementPtrInst &GEP) { in visitGetElementPtr() argument
[all …]
/third_party/mesa3d/src/gallium/drivers/swr/rasterizer/jitter/
Dbuilder_gfx_mem.cpp129 Value* BuilderGfxMem::GEP(Value* Ptr, Value* Idx, Type* Ty, bool isReadOnly, const Twine& Name) in GEP() function in SwrJit::BuilderGfxMem
135 Ptr = Builder::GEP(Ptr, Idx, nullptr, isReadOnly, Name); in GEP()
148 Ptr = Builder::GEP(Ptr, Idx, nullptr, isReadOnly, Name); in GEP()
153 Value* BuilderGfxMem::GEP(Type* Ty, Value* Ptr, Value* Idx, const Twine& Name) in GEP() function in SwrJit::BuilderGfxMem
159 Ptr = Builder::GEP(Ty, Ptr, Idx, Name); in GEP()
165 Ptr = Builder::GEP(Ty, Ptr, Idx, Name); in GEP()
170 Value* BuilderGfxMem::GEP(Value* Ptr, const std::initializer_list<Value*>& indexList, Type* Ty) in GEP() function in SwrJit::BuilderGfxMem
176 Ptr = Builder::GEP(Ptr, indexList); in GEP()
182 Ptr = Builder::GEP(Ptr, indexList); in GEP()
188 BuilderGfxMem::GEP(Value* Ptr, const std::initializer_list<uint32_t>& indexList, Type* Ty) in GEP() function in SwrJit::BuilderGfxMem
[all …]
Dbuilder_gfx_mem.h44 …virtual Value* GEP(Value* Ptr, Value* Idx, Type* Ty = nullptr, bool isReadOnly = true, const Twine…
45 virtual Value* GEP(Type* Ty, Value* Ptr, Value* Idx, const Twine& Name = "");
47 GEP(Value* Ptr, const std::initializer_list<Value*>& indexList, Type* Ty = nullptr);
49 GEP(Value* Ptr, const std::initializer_list<uint32_t>& indexList, Type* Ty = nullptr);
Dstreamout_jit.cpp138 Value* pAttrib = GEP(pStream, C(4 * decl.attribSlot)); in buildDecl()
162 pOutBuffers[decl.bufferIndex] = GEP(pOutBuffers[decl.bufferIndex], C(numComponents)); in buildDecl()
226 pOutBuffer[b] = GEP(pData, streamOffset, PointerType::get(IRB()->getInt32Ty(), 0)); in buildStream()
240 pStreamData = GEP(pStreamData, C(SWR_VTX_NUM_SLOTS * 4)); in buildStream()
245 pOutBufferStartVertex[b] = GEP(pOutBufferStartVertex[b], outBufferPitch[b]); in buildStream()
Dbuilder_mem.h48 virtual Value* GEP(Value* Ptr, Value* Idx, Type* Ty = nullptr, bool isReadOnly = true, const Twine&…
49 virtual Value* GEP(Type* Ty, Value* Ptr, Value* Idx, const Twine& Name = "");
50 virtual Value* GEP(Value* ptr, const std::initializer_list<Value*>& indexList, Type* Ty = nullptr);
52 GEP(Value* ptr, const std::initializer_list<uint32_t>& indexList, Type* Ty = nullptr);
Dbuilder_mem.cpp44 Value* Builder::GEP(Value* Ptr, Value* Idx, Type* Ty, bool isReadOnly, const Twine& Name) in GEP() function in SwrJit::Builder
49 Value* Builder::GEP(Type* Ty, Value* Ptr, Value* Idx, const Twine& Name) in GEP() function in SwrJit::Builder
54 Value* Builder::GEP(Value* ptr, const std::initializer_list<Value*>& indexList, Type* Ty) in GEP() function in SwrJit::Builder
62 Value* Builder::GEP(Value* ptr, const std::initializer_list<uint32_t>& indexList, Type* Ty) in GEP() function in SwrJit::Builder
163 return GEP(base, offset); in OFFSET_TO_NEXT_COMPONENT()
171 Value* i32Value = LOAD(GEP(basePtr, indices), name); in MEM_ADD()
173 return STORE(i32Result, GEP(basePtr, indices)); in MEM_ADD()
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Transforms/Scalar/
DNaryReassociate.h120 Instruction *tryReassociateGEP(GetElementPtrInst *GEP);
129 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP,
134 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP,
165 bool requiresSignExtension(Value *Index, GetElementPtrInst *GEP);
/third_party/mesa3d/src/gallium/drivers/swr/
Dswr_shader.cpp716 LOAD(GEP(iface->pVtxAttribMap, {C(0), attr_chan_index})); in swr_gs_llvm_fetch_input()
722 Value *pInput = LOAD(GEP(pVertex, {pVector, unwrap(swizzle_index)})); in swr_gs_llvm_fetch_input()
730 Value *attrib = LOAD(GEP(iface->pVtxAttribMap, {C(0), attr_index})); in swr_gs_llvm_fetch_input()
737 Value *pInput = LOAD(GEP(pVertex, {pVector, unwrap(swizzle_index)})); in swr_gs_llvm_fetch_input()
794 Value *pStreamOffset = GEP(pStream, pLaneOffset); in swr_gs_llvm_emit_vertex()
813 pStreamOffset = GEP(pStreamOffset, C(1)); in swr_gs_llvm_emit_vertex()
846 Value *pStreamOffset = GEP(pStream, VEXTRACT(pStreamIdOffset, C(lane))); in swr_gs_llvm_emit_vertex()
913 Value *pStreamOffset = GEP(pStream, vLaneOffset); in swr_gs_llvm_end_primitive()
1026 LOAD(GEP(iface->pVtxAttribMap, {C(0), attr_chan_index})); in swr_tcs_llvm_fetch_input()
1028 Value *pBase = GEP(iface->pTcsCtx, in swr_tcs_llvm_fetch_input()
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Target/AMDGPU/
DAMDGPUPerfHintAnalysis.cpp169 if (auto GEP = dyn_cast<GetElementPtrInst>(V)) { in isIndirectAccess() local
170 auto P = GEP->getPointerOperand(); in isIndirectAccess()
172 for (unsigned I = 1, E = GEP->getNumIndices() + 1; I != E; ++I) in isIndirectAccess()
173 WorkSet.insert(GEP->getOperand(I)); in isIndirectAccess()
241 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) { in visit() local
243 auto *Ptr = GetPointerBaseWithConstantOffset(GEP, AM.BaseOffs, *DL); in visit()
246 if (TLI->isLegalAddressingMode(*DL, AM, GEP->getResultElementType(), in visit()
247 GEP->getPointerAddressSpace())) in visit()
DAMDGPUPromoteAlloca.cpp308 GetElementPtrInst *GEP = cast<GetElementPtrInst>(Ptr); in calculateVectorIndex() local
310 auto I = GEPIdx.find(GEP); in calculateVectorIndex()
314 static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { in GEPToVectorIndex() argument
316 if (GEP->getNumOperands() != 3) in GEPToVectorIndex()
319 ConstantInt *I0 = dyn_cast<ConstantInt>(GEP->getOperand(1)); in GEPToVectorIndex()
323 return GEP->getOperand(2); in GEPToVectorIndex()
387 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(AllocaUser); in tryPromoteAllocaToVector() local
388 if (!GEP) { in tryPromoteAllocaToVector()
396 Value *Index = GEPToVectorIndex(GEP); in tryPromoteAllocaToVector()
401 LLVM_DEBUG(dbgs() << " Cannot compute vector index for GEP " << *GEP in tryPromoteAllocaToVector()
[all …]
DAMDGPUInstructionSelector.h63 const MachineInstr &GEP; member
67 GEPInfo(const MachineInstr &GEP) : GEP(GEP), Imm(0) { } in GEPInfo()
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Target/ARM/
DMVEGatherScatterLowering.cpp120 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr); in checkGEP() local
121 if (!GEP) { in checkGEP()
127 Value *GEPPtr = GEP->getPointerOperand(); in checkGEP()
134 if (GEP->getNumOperands() != 2) { in checkGEP()
139 Offsets = GEP->getOperand(1); in checkGEP()

12345