Home
last modified time | relevance | path

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

123456

/openbsd/src/gnu/llvm/llvm/lib/Transforms/Scalar/
DSeparateConstOffsetFromGEP.cpp238 static Value *Extract(Value *Idx, GetElementPtrInst *GEP,
244 static int64_t Find(Value *Idx, GetElementPtrInst *GEP,
387 bool splitGEP(GetElementPtrInst *GEP);
414 int64_t accumulateByteOffset(GetElementPtrInst *GEP, bool &NeedsExtraction);
431 bool canonicalizeArrayIndicesToPointerSize(GetElementPtrInst *GEP);
767 Value *ConstantOffsetExtractor::Extract(Value *Idx, GetElementPtrInst *GEP, in Extract() argument
770 ConstantOffsetExtractor Extractor(GEP, DT); in Extract()
774 GEP->isInBounds()); in Extract()
785 int64_t ConstantOffsetExtractor::Find(Value *Idx, GetElementPtrInst *GEP, in Find() argument
788 return ConstantOffsetExtractor(GEP, DT) in Find()
[all …]
DNaryReassociate.cpp328 static bool isGEPFoldable(GetElementPtrInst *GEP, in isGEPFoldable() argument
330 SmallVector<const Value *, 4> Indices(GEP->indices()); in isGEPFoldable()
331 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), in isGEPFoldable()
335 Instruction *NaryReassociatePass::tryReassociateGEP(GetElementPtrInst *GEP) { in tryReassociateGEP() argument
337 if (isGEPFoldable(GEP, TTI)) in tryReassociateGEP()
340 gep_type_iterator GTI = gep_type_begin(*GEP); in tryReassociateGEP()
341 for (unsigned I = 1, E = GEP->getNumOperands(); I != E; ++I, ++GTI) { in tryReassociateGEP()
343 if (auto *NewGEP = tryReassociateGEPAtIndex(GEP, I - 1, in tryReassociateGEP()
353 GetElementPtrInst *GEP) { in requiresSignExtension() argument
355 DL->getPointerSizeInBits(GEP->getType()->getPointerAddressSpace()); in requiresSignExtension()
[all …]
DStraightLineStrengthReduce.cpp138 GEP, // &B[..][i * S][..] enumerator
213 void allocateCandidatesAndFindBasisForGEP(GetElementPtrInst *GEP);
234 GetElementPtrInst *GEP);
285 static bool isGEPFoldable(GetElementPtrInst *GEP, in isGEPFoldable() argument
287 SmallVector<const Value *, 4> Indices(GEP->indices()); in isGEPFoldable()
288 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), in isGEPFoldable()
306 if (C.CandidateKind == Candidate::GEP) in isFoldable()
312 static bool hasOnlyOneNonZeroIndex(GetElementPtrInst *GEP) { in hasOnlyOneNonZeroIndex() argument
314 for (Use &Idx : GEP->indices()) { in hasOnlyOneNonZeroIndex()
331 if (C.CandidateKind == Candidate::GEP) { in isSimplestForm()
[all …]
DMergeICmps.cpp74 BCEAtom(GetElementPtrInst *GEP, LoadInst *LoadI, int BaseId, APInt Offset) in BCEAtom()
75 : GEP(GEP), LoadI(LoadI), BaseId(BaseId), Offset(Offset) {} in BCEAtom()
84 GEP = that.GEP; in operator =()
105 GetElementPtrInst *GEP = nullptr; member
162 auto *GEP = dyn_cast<GetElementPtrInst>(Addr); in visitICmpLoadOperand() local
163 if (GEP) { in visitICmpLoadOperand()
165 if (GEP->isUsedOutsideOfBlock(LoadI->getParent())) { in visitICmpLoadOperand()
169 if (!GEP->accumulateConstantOffset(DL, Offset)) in visitICmpLoadOperand()
171 Base = GEP->getPointerOperand(); in visitICmpLoadOperand()
173 return BCEAtom(GEP, LoadI, BaseId.getBaseId(Base), Offset); in visitICmpLoadOperand()
[all …]
DConstraintElimination.cpp238 decomposeGEP(GetElementPtrInst &GEP, in decomposeGEP() argument
243 if (DL.getIndexTypeSizeInBits(GEP.getPointerOperand()->getType()) > 64) in decomposeGEP()
244 return &GEP; in decomposeGEP()
246 if (!GEP.isInBounds()) in decomposeGEP()
247 return &GEP; in decomposeGEP()
251 Type *PtrTy = GEP.getType()->getScalarType(); in decomposeGEP()
255 if (!GEP.collectOffset(DL, BitWidth, VariableOffsets, ConstantOffset)) in decomposeGEP()
256 return &GEP; in decomposeGEP()
260 auto *InnerGEP = dyn_cast<GetElementPtrInst>(GEP.getPointerOperand()); in decomposeGEP()
269 return &GEP; in decomposeGEP()
[all …]
/openbsd/src/gnu/llvm/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()
120 auto *GEP = cast<GEPOperator>(U); in splitGlobal() local
121 unsigned I = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue(); in splitGlobal()
127 for (unsigned I = 3; I != GEP->getNumOperands(); ++I) in splitGlobal()
128 Ops.push_back(GEP->getOperand(I)); in splitGlobal()
132 GEP->isInBounds()); in splitGlobal()
[all …]
/openbsd/src/gnu/llvm/llvm/include/llvm/IR/
DGetElementPtrTypeIterator.h123 inline gep_type_iterator gep_type_begin(const User *GEP) { in gep_type_begin() argument
124 auto *GEPOp = cast<GEPOperator>(GEP); in gep_type_begin()
127 GEP->op_begin() + 1); in gep_type_begin()
130 inline gep_type_iterator gep_type_end(const User *GEP) { in gep_type_end() argument
131 return gep_type_iterator::end(GEP->op_end()); in gep_type_end()
134 inline gep_type_iterator gep_type_begin(const User &GEP) { in gep_type_begin() argument
135 auto &GEPOp = cast<GEPOperator>(GEP); in gep_type_begin()
138 GEP.op_begin() + 1); in gep_type_begin()
141 inline gep_type_iterator gep_type_end(const User &GEP) { in gep_type_end() argument
142 return gep_type_iterator::end(GEP.op_end()); in gep_type_end()
/openbsd/src/gnu/llvm/llvm/lib/Analysis/
DLocal.cpp23 User *GEP, bool NoAssumptions) { in emitGEPOffset() argument
24 GEPOperator *GEPOp = cast<GEPOperator>(GEP); in emitGEPOffset()
25 Type *IntIdxTy = DL.getIndexType(GEP->getType()); in emitGEPOffset()
37 gep_type_iterator GTI = gep_type_begin(GEP); in emitGEPOffset()
38 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; in emitGEPOffset()
79 GEP->getName() + ".idx", false /*NUW*/, in emitGEPOffset()
86 Result = Builder->CreateAdd(Result, Offset, GEP->getName() + ".offs", in emitGEPOffset()
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(), GEPOps[0], in PHITranslateSubExpr()
231 GEP->isInBounds(), {DL, TLI, DT, AC})) { in PHITranslateSubExpr()
242 if (GEPI->getType() == GEP->getType() && in PHITranslateSubExpr()
243 GEPI->getSourceElementType() == GEP->getSourceElementType() && in PHITranslateSubExpr()
397 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in InsertPHITranslatedSubExpr() local
[all …]
DTypeMetadataUtils.cpp61 } else if (auto GEP = dyn_cast<GetElementPtrInst>(User)) { in findLoadCallsAtConstantOffset() local
63 if (VPtr == GEP->getPointerOperand() && GEP->hasAllConstantIndices()) { in findLoadCallsAtConstantOffset()
64 SmallVector<Value *, 8> Indices(drop_begin(GEP->operands())); in findLoadCallsAtConstantOffset()
66 GEP->getSourceElementType(), Indices); in findLoadCallsAtConstantOffset()
/openbsd/src/gnu/llvm/llvm/lib/Transforms/Utils/
DRelLookupTableConverter.cpp36 GetElementPtrInst *GEP = in shouldConvertToRelLookupTable() local
38 if (!GEP || !GEP->hasOneUse() || in shouldConvertToRelLookupTable()
39 GV.getValueType() != GEP->getSourceElementType()) in shouldConvertToRelLookupTable()
42 LoadInst *Load = dyn_cast<LoadInst>(GEP->use_begin()->getUser()); in shouldConvertToRelLookupTable()
44 Load->getType() != GEP->getResultElementType()) in shouldConvertToRelLookupTable()
131 GetElementPtrInst *GEP = in convertToRelLookupTable() local
133 LoadInst *Load = cast<LoadInst>(GEP->use_begin()->getUser()); in convertToRelLookupTable()
136 BasicBlock *BB = GEP->getParent(); in convertToRelLookupTable()
144 Builder.SetInsertPoint(GEP); in convertToRelLookupTable()
145 Value *Index = GEP->getOperand(2); in convertToRelLookupTable()
[all …]
/openbsd/src/gnu/llvm/llvm/docs/
DGetElementPtr.rst2 The Often Misunderstood GEP Instruction
12 `GetElementPtr <LangRef.html#getelementptr-instruction>`_ (GEP) instruction.
13 Questions about the wily GEP instruction are probably the most frequently
15 out the sources of confusion and show that the GEP instruction is really quite
21 When people are first confronted with the GEP instruction, they tend to relate
23 indexing and field selection. GEP closely resembles C array indexing and field
27 What is the first index of the GEP instruction?
46 provide the GEP instruction with two index operands. The first operand indexes
62 computation. The second operand to the GEP instruction must be a value of a
63 pointer type. The value of the pointer is provided directly to the GEP
[all …]
/openbsd/src/gnu/llvm/llvm/lib/Target/RISCV/
DRISCVGatherScatterLowering.cpp71 std::pair<Value *, Value *> determineBaseAndStride(GetElementPtrInst *GEP,
337 RISCVGatherScatterLowering::determineBaseAndStride(GetElementPtrInst *GEP, in determineBaseAndStride() argument
340 auto I = StridedAddrs.find(GEP); in determineBaseAndStride()
344 SmallVector<Value *, 2> Ops(GEP->operands()); in determineBaseAndStride()
354 gep_type_iterator GTI = gep_type_begin(GEP); in determineBaseAndStride()
355 for (unsigned i = 1, e = GEP->getNumOperands(); i != e; ++i, ++GTI) { in determineBaseAndStride()
380 Type *VecIntPtrTy = DL->getIntPtrType(GEP->getType()); in determineBaseAndStride()
389 Builder.SetInsertPoint(GEP); in determineBaseAndStride()
393 Type *SourceTy = GEP->getSourceElementType(); in determineBaseAndStride()
406 StridedAddrs[GEP] = P; in determineBaseAndStride()
[all …]
/openbsd/src/gnu/llvm/llvm/lib/Transforms/InstCombine/
DInstructionCombining.cpp206 Value *InstCombinerImpl::EmitGEPOffset(User *GEP) { in EmitGEPOffset() argument
207 return llvm::emitGEPOffset(&Builder, DL, GEP); in EmitGEPOffset()
1399 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { in shouldMergeGEPs() argument
1403 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && in shouldMergeGEPs()
1962 static Instruction *foldSelectGEP(GetElementPtrInst &GEP, in foldSelectGEP() argument
1964 if (!GEP.hasAllConstantIndices()) in foldSelectGEP()
1970 if (!match(GEP.getPointerOperand(), m_Instruction(Sel)) || in foldSelectGEP()
1978 SmallVector<Value *, 4> IndexC(GEP.indices()); in foldSelectGEP()
1979 bool IsInBounds = GEP.isInBounds(); in foldSelectGEP()
1980 Type *Ty = GEP.getSourceElementType(); in foldSelectGEP()
[all …]
DInstCombineLoadStoreAlloca.cpp87 if (auto *GEP = dyn_cast<GetElementPtrInst>(I)) { in isOnlyCopiedFromConstantMemory() local
90 Worklist.emplace_back(I, IsOffset || !GEP->hasAllZeroIndices()); in isOnlyCopiedFromConstantMemory()
225 Instruction *GEP = GetElementPtrInst::CreateInBounds( in simplifyAllocaArraySize() local
227 IC.InsertNewInstBefore(GEP, *It); in simplifyAllocaArraySize()
231 return IC.replaceInstUsesWith(AI, GEP); in simplifyAllocaArraySize()
381 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(I)) { in replace() local
382 auto *V = getReplacement(GEP->getPointerOperand()); in replace()
385 Indices.append(GEP->idx_begin(), GEP->idx_end()); in replace()
387 GetElementPtrInst::Create(GEP->getSourceElementType(), V, Indices); in replace()
388 IC.InsertNewInstWith(NewI, *GEP); in replace()
[all …]
/openbsd/src/gnu/llvm/llvm/lib/Target/ARM/
DMVEGatherScatterLowering.cpp96 GetElementPtrInst *GEP, IRBuilder<> &Builder);
148 Value *foldGEP(GetElementPtrInst *GEP, Value *&Offsets, unsigned &Scale,
231 if (auto *GEP = dyn_cast<GetElementPtrInst>(Ptr)) { in decomposePtr() local
232 if (Value *V = decomposeGEP(Offsets, Ty, GEP, Builder)) { in decomposePtr()
234 computeScale(GEP->getSourceElementType()->getPrimitiveSizeInBits(), in decomposePtr()
256 GetElementPtrInst *GEP, in decomposeGEP() argument
258 if (!GEP) { in decomposeGEP()
265 Value *GEPPtr = GEP->getPointerOperand(); in decomposeGEP()
266 Offsets = GEP->getOperand(1); in decomposeGEP()
271 if (GEP->getNumOperands() != 2) { in decomposeGEP()
[all …]
/openbsd/src/gnu/llvm/llvm/include/llvm/Transforms/Scalar/
DNaryReassociate.h120 Instruction *tryReassociateGEP(GetElementPtrInst *GEP);
129 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP,
134 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP,
178 bool requiresSignExtension(Value *Index, GetElementPtrInst *GEP);
/openbsd/src/gnu/llvm/llvm/tools/llvm-reduce/deltas/
DReduceInstructionFlags.cpp33 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) { in reduceFlagsInModule() local
34 if (GEP->isInBounds() && !O.shouldKeep()) in reduceFlagsInModule()
35 GEP->setIsInBounds(false); in reduceFlagsInModule()
/openbsd/src/gnu/llvm/llvm/lib/Target/AMDGPU/
DAMDGPUPerfHintAnalysis.cpp163 if (auto GEP = dyn_cast<GetElementPtrInst>(V)) { in isIndirectAccess() local
164 auto P = GEP->getPointerOperand(); in isIndirectAccess()
166 for (unsigned I = 1, E = GEP->getNumIndices() + 1; I != E; ++I) in isIndirectAccess()
167 WorkSet.insert(GEP->getOperand(I)); in isIndirectAccess()
258 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) { in visit() local
260 auto *Ptr = GetPointerBaseWithConstantOffset(GEP, AM.BaseOffs, *DL); in visit()
263 if (TLI->isLegalAddressingMode(*DL, AM, GEP->getResultElementType(), in visit()
264 GEP->getPointerAddressSpace())) in visit()
DAMDGPUPromoteAlloca.cpp340 auto *GEP = dyn_cast<GetElementPtrInst>(Ptr->stripPointerCasts()); in calculateVectorIndex() local
341 if (!GEP) in calculateVectorIndex()
344 auto I = GEPIdx.find(GEP); in calculateVectorIndex()
349 static Value *GEPToVectorIndex(GetElementPtrInst *GEP, AllocaInst *Alloca, in GEPToVectorIndex() argument
353 unsigned BW = DL.getIndexTypeSizeInBits(GEP->getType()); in GEPToVectorIndex()
356 if (GEP->getPointerOperand()->stripPointerCasts() != Alloca || in GEPToVectorIndex()
357 !GEP->collectOffset(DL, BW, VarOffsets, ConstOffset)) in GEPToVectorIndex()
379 return ConstantInt::get(GEP->getContext(), Quot); in GEPToVectorIndex()
472 if (auto *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in tryPromoteAllocaToVector() local
475 Value *Index = GEPToVectorIndex(GEP, Alloca, VecEltTy, DL); in tryPromoteAllocaToVector()
[all …]
DAMDGPULowerModuleLDSPass.cpp1091 Constant *GEP = ConstantExpr::getGetElementPtr(LDSTy, SGV, GEPIdx, true); in createLDSVariableReplacement() local
1096 Map[GV] = GEP; in createLDSVariableReplacement()
1140 Constant *GEP = Replacement.LDSVarsToConstantGEP[GV]; in replaceLDSVariablesWithStruct() local
1142 GV->replaceUsesWithIf(GEP, Predicate); in replaceLDSVariablesWithStruct()
1144 APInt APOff(DL.getIndexTypeSizeInBits(GEP->getType()), 0); in replaceLDSVariablesWithStruct()
1145 GEP->stripAndAccumulateInBoundsConstantOffsets(DL, APOff); in replaceLDSVariablesWithStruct()
1158 refineUsesAlignmentAndAA(GEP, A, DL, AliasScope, NoAlias); in replaceLDSVariablesWithStruct()
1203 if (auto *GEP = dyn_cast<GetElementPtrInst>(U)) { in refineUsesAlignmentAndAA() local
1204 unsigned BitWidth = DL.getIndexTypeSizeInBits(GEP->getType()); in refineUsesAlignmentAndAA()
1206 if (GEP->getPointerOperand() == Ptr) { in refineUsesAlignmentAndAA()
[all …]
/openbsd/src/gnu/llvm/llvm/lib/IR/
DTypeFinder.cpp79 if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) in run() local
80 incorporateType(GEP->getSourceElementType()); in run()
155 if (auto *GEP = dyn_cast<GEPOperator>(V)) in incorporateValue() local
156 incorporateType(GEP->getSourceElementType()); in incorporateValue()
DConstantFold.cpp635 if (auto *GEP = dyn_cast<GEPOperator>(CE)) { in ConstantFoldExtractElementInstruction() local
649 GEP->getSourceElementType()); in ConstantFoldExtractElementInstruction()
1964 static Constant *foldGEPOfGEP(GEPOperator *GEP, Type *PointeeTy, bool InBounds, in foldGEPOfGEP() argument
1966 if (PointeeTy != GEP->getResultElementType()) in foldGEPOfGEP()
1973 NewIndices.reserve(Idxs.size() + GEP->getNumIndices()); in foldGEPOfGEP()
1974 NewIndices.append(GEP->idx_begin(), GEP->idx_end()); in foldGEPOfGEP()
1977 GEP->getSourceElementType(), cast<Constant>(GEP->getPointerOperand()), in foldGEPOfGEP()
1978 NewIndices, InBounds && GEP->isInBounds(), GEP->getInRangeIndex()); in foldGEPOfGEP()
1981 gep_type_iterator LastI = gep_type_end(GEP); in foldGEPOfGEP()
1982 for (gep_type_iterator I = gep_type_begin(GEP), E = gep_type_end(GEP); in foldGEPOfGEP()
[all …]
/openbsd/src/gnu/llvm/llvm/lib/Target/NVPTX/
DNVPTXLowerArgs.cpp180 if (auto *GEP = dyn_cast<GetElementPtrInst>(I.OldInstruction)) { in convertToParamAS() local
181 SmallVector<Value *, 4> Indices(GEP->indices()); in convertToParamAS()
182 auto *NewGEP = GetElementPtrInst::Create(GEP->getSourceElementType(), in convertToParamAS()
184 GEP->getName(), GEP); in convertToParamAS()
185 NewGEP->setIsInBounds(GEP->isInBounds()); in convertToParamAS()
/openbsd/src/gnu/llvm/llvm/lib/Transforms/AggressiveInstCombine/
DAggressiveInstCombine.cpp533 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(LI->getPointerOperand()); in tryToRecognizeTableBasedCttz() local
534 if (!GEP || !GEP->isInBounds() || GEP->getNumIndices() != 2) in tryToRecognizeTableBasedCttz()
537 if (!GEP->getSourceElementType()->isArrayTy()) in tryToRecognizeTableBasedCttz()
540 uint64_t ArraySize = GEP->getSourceElementType()->getArrayNumElements(); in tryToRecognizeTableBasedCttz()
544 GlobalVariable *GVTable = dyn_cast<GlobalVariable>(GEP->getPointerOperand()); in tryToRecognizeTableBasedCttz()
553 if (!match(GEP->idx_begin()->get(), m_ZeroInt())) in tryToRecognizeTableBasedCttz()
556 Value *Idx2 = std::next(GEP->idx_begin())->get(); in tryToRecognizeTableBasedCttz()

123456