Searched refs:GEP (Results 1 - 25 of 66) sorted by relevance

123

/freebsd-11.0-release/contrib/llvm/lib/Transforms/Scalar/
H A DNaryReassociate.cpp131 // 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,
303 isGEPFoldable(GetElementPtrInst *GEP, const TargetTransformInfo *TTI, const DataLayout *DL) argument
342 tryReassociateGEP(GetElementPtrInst *GEP) argument
358 requiresSignExtension(Value *Index, GetElementPtrInst *GEP) argument
366 tryReassociateGEPAtIndex(GetElementPtrInst *GEP, unsigned I, Type *IndexedType) argument
400 tryReassociateGEPAtIndex( GetElementPtrInst *GEP, unsigned I, Value *LHS, Value *RHS, Type *IndexedType) argument
[all...]
H A DSeparateConstOffsetFromGEP.cpp35 // 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.
82 // Another improvement enabled by the LowerGEP flag is to lower a GEP with
103 // lower a GEP with multiple indices into arithmetic operations:
125 // If the target uses alias analysis in codegen, this pass will lower a GEP
149 // LICM (Loop Invariant Code Motion) can not hoist/sink a GEP of multiple
150 // indices if one of the index is variant. If we lower such GEP into invariant
153 // target's addressing modes. A GEP with multiple indices may not match and will
154 // not be sunk. If we lower such GEP into smaller parts, CGP may sink some of
186 cl::desc("Do not separate the constant offset from a GEP instructio
690 Extract(Value *Idx, GetElementPtrInst *GEP, User *&UserChainTail, const DominatorTree *DT) argument
708 Find(Value *Idx, GetElementPtrInst *GEP, const DominatorTree *DT) argument
717 canonicalizeArrayIndicesToPointerSize( GetElementPtrInst *GEP) argument
736 accumulateByteOffset(GetElementPtrInst *GEP, bool &NeedsExtraction) argument
885 splitGEP(GetElementPtrInst *GEP) argument
[all...]
H A DStraightLineStrengthReduce.cpp88 GEP, // &B[..][i * S][..] enumerator in enum:__anon3265::StraightLineStrengthReduce::Candidate::Kind
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, argument
246 if (GlobalVariable *GV = dyn_cast<GlobalVariable>(GEP->getPointerOperand()))
251 gep_type_iterator GTI = gep_type_begin(GEP);
295 hasOnlyOneNonZeroIndex(GetElementPtrInst *GEP) argument
476 factorArrayIndex(Value *ArrayIdx, const SCEV *Base, uint64_t ElementSize, GetElementPtrInst *GEP) argument
511 allocateCandidatesAndFindBasisForGEP( GetElementPtrInst *GEP) argument
[all...]
H A DLoadCombine.cpp94 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();
/freebsd-11.0-release/contrib/llvm/lib/Target/NVPTX/
H A DNVPTXFavorNonGenericAddrSpaces.cpp14 // optimization also recursively traces into a GEP's pointer operand and a
25 // First, function hoistAddrSpaceCastFrom reorders the addrspacecast, the GEP,
91 /// Recursively traces into a GEP's pointer operand or a bitcast's source to
106 Value *hoistAddrSpaceCastFromGEP(GEPOperator *GEP, int Depth);
146 GEPOperator *GEP, int Depth) {
148 hoistAddrSpaceCastFrom(GEP->getPointerOperand(), Depth + 1);
156 SmallVector<Value *, 8> Indices(GEP->idx_begin(), GEP->idx_end());
158 if (Instruction *GEPI = dyn_cast<Instruction>(GEP)) {
159 // GEP
145 hoistAddrSpaceCastFromGEP( GEPOperator *GEP, int Depth) argument
[all...]
H A DNVVMReflect.cpp177 const ConstantExpr *GEP = cast<ConstantExpr>(Str); local
179 const Value *Sym = GEP->getOperand(0);
/freebsd-11.0-release/contrib/llvm/include/llvm/IR/
H A DGetElementPtrTypeIterator.h103 inline gep_type_iterator gep_type_begin(const User *GEP) { argument
104 auto *GEPOp = cast<GEPOperator>(GEP);
109 GEP->op_begin() + 1);
111 inline gep_type_iterator gep_type_end(const User *GEP) { argument
112 return gep_type_iterator::end(GEP->op_end());
114 inline gep_type_iterator gep_type_begin(const User &GEP) { argument
115 auto &GEPOp = cast<GEPOperator>(GEP);
120 GEP.op_begin() + 1);
122 inline gep_type_iterator gep_type_end(const User &GEP) { argument
123 return gep_type_iterator::end(GEP
[all...]
/freebsd-11.0-release/contrib/llvm/include/llvm/Transforms/Utils/
H A DLocal.h194 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &DL, User *GEP, argument
196 GEPOperator *GEPOp = cast<GEPOperator>(GEP);
197 Type *IntPtrTy = DL.getIntPtrType(GEP->getType());
200 // If the GEP is inbounds, we know that none of the addressing operations will
208 gep_type_iterator GTI = gep_type_begin(GEP);
209 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e;
227 GEP->getName()+".offs");
235 Result = Builder->CreateAdd(Result, Scale, GEP->getName()+".offs");
244 GEP
[all...]
/freebsd-11.0-release/contrib/llvm/lib/Target/AMDGPU/
H A DAMDGPUTargetTransformInfo.cpp42 const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(&I); local
43 if (!GEP || GEP->getAddressSpace() != AMDGPUAS::PRIVATE_ADDRESS)
46 const Value *Ptr = GEP->getPointerOperand();
H A DAMDGPUPromoteAlloca.cpp115 GetElementPtrInst *GEP = cast<GetElementPtrInst>(Ptr);
117 auto I = GEPIdx.find(GEP);
121 static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { argument
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); local
172 if (!GEP) {
180 Value *Index = GEPToVectorIndex(GEP);
182 // If we can't compute a vector index from this GEP, the
[all...]
/freebsd-11.0-release/contrib/llvm/lib/Analysis/
H A DPHITransAddr.cpp217 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)) {
401 BasicBlock *CurBB = GEP
[all...]
H A DMemoryBuiltins.cpp403 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V))
404 return visitGEPOperator(*GEP);
522 SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) { argument
523 SizeOffsetType PtrData = compute(GEP.getPointerOperand());
525 if (!bothKnown(PtrData) || !GEP.accumulateConstantOffset(DL, Offset))
637 } else if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
638 Result = visitGEPOperator(*GEP);
714 ObjectSizeOffsetEvaluator::visitGEPOperator(GEPOperator &GEP) { argument
715 SizeOffsetEvalType PtrData = compute_(GEP.getPointerOperand());
719 Value *Offset = EmitGEPOffset(&Builder, DL, &GEP, /*NoAssumption
[all...]
H A DVectorUtils.cpp228 /// \brief Find the operand of the GEP that should be checked for consecutive
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); local
258 if (!GEP)
261 unsigned InductionOperand = getGEPInductionOperand(GEP);
265 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i)
267 !SE->isLoopInvariant(SE->getSCEV(GEP->getOperand(i)), Lp))
269 return GEP->getOperand(InductionOperand);
H A DInlineCost.cpp109 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) { argument
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) { argument
267 for (gep_type_iterator GTI = gep_type_begin(GEP), GTE = gep_type_end(GEP);
[all...]
/freebsd-11.0-release/contrib/llvm/lib/Transforms/InstCombine/
H A DInstructionCombining.cpp79 Value *InstCombiner::EmitGEPOffset(User *GEP) { argument
80 return llvm::EmitGEPOffset(Builder, DL, GEP);
929 /// is a sequence of GEP indices into the pointed type that will land us at the
990 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { argument
991 // If this GEP has only 0 indices, it is the same pointer as
992 // Src. If Src is not a trivial GEP too, don't combine
994 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() &&
1334 Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { argument
1335 SmallVector<Value*, 8> Ops(GEP.op_begin(), GEP
2330 Value *GEP = Builder->CreateInBoundsGEP(L->getType(), local
[all...]
H A DInstCombinePHI.cpp136 // 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)); local
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
[all...]
H A DInstCombineLoadStoreAlloca.cpp80 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()));
202 Instruction *GEP = local
204 IC.InsertNewInstBefore(GEP, *It);
208 return IC.ReplaceInstUsesWith(AI, GEP);
662 // Then we know that we can replace %x in the GEP with i64 0.
664 // FIXME: We could fold any GEP index to zero that would cause UB if it were
673 // Find the first non-zero index of a GEP. If all indices are zero, return
724 // FIXME: If the GEP i
[all...]
/freebsd-11.0-release/contrib/llvm/lib/Transforms/IPO/
H A DArgumentPromotion.cpp81 /// 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
961 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->user_back()); local
[all...]
/freebsd-11.0-release/contrib/llvm/lib/IR/
H A DValue.cpp436 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
440 if (!GEP->hasAllZeroIndices())
444 if (!GEP->hasAllConstantIndices())
448 if (!GEP->isInBounds())
452 V = GEP->getPointerOperand();
497 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) {
498 if (!GEP->isInBounds())
501 if (!GEP->accumulateConstantOffset(DL, GEPOffset))
504 V = GEP->getPointerOperand();
/freebsd-11.0-release/contrib/llvm/include/llvm/Analysis/
H A DTargetTransformInfoImpl.h54 llvm_unreachable("Use getGEPCost for GEP operations!");
426 // We assume that the cost of Scalar GEP with constant index and the
427 // cost of Vector GEP with splat constant index are the same.
446 assert(ConstIdx && "Unexpected GEP index");
478 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(U)) {
479 SmallVector<Value *, 4> Indices(GEP->idx_begin(), GEP->idx_end());
481 GEP->getSourceElementType(), GEP->getPointerOperand(), Indices);
H A DMemoryBuiltins.h182 SizeOffsetType visitGEPOperator(GEPOperator &GEP);
247 SizeOffsetEvalType visitGEPOperator(GEPOperator &GEP);
/freebsd-11.0-release/contrib/llvm/lib/Target/X86/
H A DX86WinEHState.cpp387 if (auto *GEP = dyn_cast<GetElementPtrInst>(Link)) {
388 GEP = cast<GetElementPtrInst>(GEP->clone());
389 Builder.Insert(GEP);
390 Link = GEP;
/freebsd-11.0-release/contrib/llvm/lib/Transforms/Utils/
H A DCodeExtractor.cpp368 GetElementPtrInst *GEP = GetElementPtrInst::Create( local
370 RewriteVal = new LoadInst(GEP, "loadgep_" + inputs[i]->getName(), TI);
469 GetElementPtrInst *GEP = GetElementPtrInst::Create( local
471 codeReplacer->getInstList().push_back(GEP);
472 StoreInst *SI = new StoreInst(StructValues[i], GEP);
494 GetElementPtrInst *GEP = GetElementPtrInst::Create( local
496 codeReplacer->getInstList().push_back(GEP);
497 Output = GEP;
612 GetElementPtrInst *GEP = GetElementPtrInst::Create( local
615 new StoreInst(outputs[out], GEP, NTRe
[all...]
H A DValueMapper.cpp486 if (auto *GEP = dyn_cast<GetElementPtrInst>(I)) {
487 GEP->setSourceElementType(
488 TypeMapper->remapType(GEP->getSourceElementType()));
489 GEP->setResultElementType(
490 TypeMapper->remapType(GEP->getResultElementType()));
/freebsd-11.0-release/contrib/llvm/lib/CodeGen/
H A DGlobalMerge.cpp452 Constant *GEP = local
454 Globals[k]->replaceAllUsesWith(GEP);
464 GlobalAlias::create(Tys[idx], AddrSpace, Linkage, Name, GEP, &M);

Completed in 355 milliseconds

123