/freebsd-13-stable/contrib/llvm-project/llvm/include/llvm/Analysis/Utils/ |
H A D | Local.h | 29 Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &DL, User *GEP, argument 31 GEPOperator *GEPOp = cast<GEPOperator>(GEP); 32 Type *IntIdxTy = DL.getIndexType(GEP->getType()); 35 // If the GEP is inbounds, we know that none of the addressing operations will 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().str()+".offs"); 74 Result = Builder->CreateAdd(Result, Scale, GEP->getName().str()+".offs"); 89 GEP [all...] |
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Transforms/IPO/ |
H A D | GlobalSplit.cpp | 9 // This pass uses inrange annotations on GEP indices to split globals where 60 auto *GEP = dyn_cast<GEPOperator>(U); 61 if (!GEP || !GEP->getInRangeIndex() || *GEP->getInRangeIndex() != 1 || 62 !isa<ConstantInt>(GEP->getOperand(1)) || 63 !cast<ConstantInt>(GEP->getOperand(1))->isZero() || 64 !isa<ConstantInt>(GEP->getOperand(2))) 120 auto *GEP = cast<GEPOperator>(U); local 121 unsigned I = cast<ConstantInt>(GEP [all...] |
H A D | ArgumentPromotion.cpp | 98 /// A vector used to hold the indices of a single GEP instruction 121 // handle cases where there are both a direct load and GEP accesses. 126 // what the new GEP/Load instructions we are inserting look like. 178 // and gep+loads with the GEP indices. 248 // Loop over the operands, inserting GEP and loads in the caller as 258 // Emit a GEP and load for each element of the struct. 287 // This satisfies GEP constraints. 298 // And create a GEP to extract those indices. 435 GetElementPtrInst *GEP = cast<GetElementPtrInst>(I->user_back()); local 437 Operands.reserve(GEP [all...] |
H A D | GlobalOpt.cpp | 179 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I)) { 180 if (!GEP->hasAllConstantIndices()) 324 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) { 329 if (!isa<ConstantExpr>(GEP->getOperand(0))) { 331 ConstantFoldInstruction(GEP, DL, &GetTLI(*GEP->getFunction()))); 335 // If the initializer is an all-null value and we have an inbounds GEP, 336 // we already know what the result of any load from that GEP is. 338 if (Init && isa<ConstantAggregateZero>(Init) && GEP->isInBounds()) 339 SubInit = Constant::getNullValue(GEP [all...] |
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
H A D | NaryReassociate.cpp | 298 static bool isGEPFoldable(GetElementPtrInst *GEP, argument 301 for (auto I = GEP->idx_begin(); I != GEP->idx_end(); ++I) 303 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), 307 Instruction *NaryReassociatePass::tryReassociateGEP(GetElementPtrInst *GEP) { argument 308 // Not worth reassociating GEP if it is foldable. 309 if (isGEPFoldable(GEP, TTI)) 312 gep_type_iterator GTI = gep_type_begin(*GEP); 313 for (unsigned I = 1, E = GEP 324 requiresSignExtension(Value *Index, GetElementPtrInst *GEP) argument 332 tryReassociateGEPAtIndex(GetElementPtrInst *GEP, unsigned I, Type *IndexedType) argument 367 tryReassociateGEPAtIndex(GetElementPtrInst *GEP, unsigned I, Value *LHS, Value *RHS, Type *IndexedType) argument [all...] |
H A D | SeparateConstOffsetFromGEP.cpp | 34 // each GEP, wasting tons of registers. It emits the following PTX for the 50 // It works by splitting each GEP into a variadic base and a constant offset. 81 // Another improvement enabled by the LowerGEP flag is to lower a GEP with 102 // lower a GEP with multiple indices into arithmetic operations: 124 // If the target uses alias analysis in codegen, this pass will lower a GEP 148 // LICM (Loop Invariant Code Motion) can not hoist/sink a GEP of multiple 149 // indices if one of the index is variant. If we lower such GEP into invariant 152 // target's addressing modes. A GEP with multiple indices may not match and will 153 // not be sunk. If we lower such GEP into smaller parts, CGP may sink some of 202 cl::desc("Do not separate the constant offset from a GEP instructio 752 Extract(Value *Idx, GetElementPtrInst *GEP, User *&UserChainTail, const DominatorTree *DT) argument 770 Find(Value *Idx, GetElementPtrInst *GEP, const DominatorTree *DT) argument 779 canonicalizeArrayIndicesToPointerSize( GetElementPtrInst *GEP) argument 798 accumulateByteOffset(GetElementPtrInst *GEP, bool &NeedsExtraction) argument 947 splitGEP(GetElementPtrInst *GEP) argument [all...] |
H A D | StraightLineStrengthReduce.cpp | 107 GEP, // &B[..][i * S][..] enumerator in enum:__anon4716::StraightLineStrengthReduce::Candidate::Kind 119 // Note that Index and Stride of a GEP candidate do not necessarily have the 201 void allocateCandidatesAndFindBasisForGEP(GetElementPtrInst *GEP); 222 GetElementPtrInst *GEP); 225 // GEP and the bump is not divisible by the element size of the GEP, this 227 // basis using an ugly GEP. 273 static bool isGEPFoldable(GetElementPtrInst *GEP, argument 276 for (auto I = GEP->idx_begin(); I != GEP 302 hasOnlyOneNonZeroIndex(GetElementPtrInst *GEP) argument 483 factorArrayIndex(Value *ArrayIdx, const SCEV *Base, uint64_t ElementSize, GetElementPtrInst *GEP) argument 518 allocateCandidatesAndFindBasisForGEP( GetElementPtrInst *GEP) argument [all...] |
H A D | MergeICmps.cpp | 83 BCEAtom(GetElementPtrInst *GEP, LoadInst *LoadI, int BaseId, APInt Offset) argument 84 : GEP(GEP), LoadI(LoadI), BaseId(BaseId), Offset(Offset) {} 93 GEP = that.GEP; 114 GetElementPtrInst *GEP = nullptr; member in struct:__anon4690::BCEAtom 157 auto *const GEP = dyn_cast<GetElementPtrInst>(Addr); local 158 if (!GEP) 160 LLVM_DEBUG(dbgs() << "GEP\n"); 161 if (GEP [all...] |
/freebsd-13-stable/contrib/llvm-project/llvm/include/llvm/IR/ |
H A D | GetElementPtrTypeIterator.h | 100 // the first element this is an unbounded array of the GEP's source element 133 inline gep_type_iterator gep_type_begin(const User *GEP) { argument 134 auto *GEPOp = cast<GEPOperator>(GEP); 137 GEP->op_begin() + 1); 140 inline gep_type_iterator gep_type_end(const User *GEP) { argument 141 return gep_type_iterator::end(GEP->op_end()); 144 inline gep_type_iterator gep_type_begin(const User &GEP) { argument 145 auto &GEPOp = cast<GEPOperator>(GEP); 148 GEP.op_begin() + 1); 151 inline gep_type_iterator gep_type_end(const User &GEP) { argument [all...] |
/freebsd-13-stable/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar/ |
H A D | NaryReassociate.h | 119 // Reassociate GEP for better CSE. 120 Instruction *tryReassociateGEP(GetElementPtrInst *GEP); 122 // Try splitting GEP at the I-th index and see whether either part can be 125 // \p IndexedType The element type indexed by GEP's I-th index. This is 127 // GEP->getIndexedType(GEP->getPointerOperand(), 0-th index, 129 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP, 132 // Given GEP's I-th index = LHS + RHS, see whether &Base[..][LHS][..] or 133 // &Base[..][RHS][..] can be CSE'ed and rewrite GEP accordingly. 134 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP, [all...] |
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Transforms/Vectorize/ |
H A D | VPlanTransforms.cpp | 72 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { 74 GEP, Plan->mapToVPValues(GEP->operands()), OrigLoop);
|
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Analysis/ |
H A D | PHITransAddr.cpp | 214 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { 217 for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) { 218 Value *GEPOp = PHITranslateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT); 221 AnyChanged |= GEPOp != GEP->getOperand(i); 226 return GEP; 228 // Simplify the GEP to handle 'gep x, 0' -> x etc. 229 if (Value *V = SimplifyGEPInst(GEP->getSourceElementType(), 237 // Scan to see if we have this GEP available. 241 if (GEPI->getType() == GEP->getType() && 396 if (GetElementPtrInst *GEP [all...] |
H A D | TypeMetadataUtils.cpp | 61 } else if (auto GEP = dyn_cast<GetElementPtrInst>(User)) { 62 // Take into account the GEP offset. 63 if (VPtr == GEP->getPointerOperand() && GEP->hasAllConstantIndices()) { 64 SmallVector<Value *, 8> Indices(GEP->op_begin() + 1, GEP->op_end()); 66 GEP->getSourceElementType(), Indices);
|
H A D | MemoryBuiltins.cpp | 611 if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) 612 return visitGEPOperator(*GEP); 772 SizeOffsetType ObjectSizeOffsetVisitor::visitGEPOperator(GEPOperator &GEP) { argument 773 SizeOffsetType PtrData = compute(GEP.getPointerOperand()); 774 APInt Offset(DL.getIndexTypeSizeInBits(GEP.getPointerOperand()->getType()), 0); 775 if (!bothKnown(PtrData) || !GEP.accumulateConstantOffset(DL, Offset)) 918 } else if (GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 919 Result = visitGEPOperator(*GEP); 995 ObjectSizeOffsetEvaluator::visitGEPOperator(GEPOperator &GEP) { argument 996 SizeOffsetEvalType PtrData = compute_(GEP [all...] |
H A D | Loads.cpp | 79 if (const GEPOperator *GEP = dyn_cast<GEPOperator>(V)) { 80 const Value *Base = GEP->getPointerOperand(); 82 APInt Offset(DL.getIndexTypeSizeInBits(GEP->getType()), 0); 83 if (!GEP->accumulateConstantOffset(DL, Offset) || Offset.isNegative() || 89 // GEP (== Base + Offset) is dereferenceable for Size bytes. If the base 91 // then the GEP (== Base + Offset == k_0 * Align + k_1 * Align) is also
|
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Transforms/InstCombine/ |
H A D | InstructionCombining.cpp | 158 Value *InstCombiner::EmitGEPOffset(User *GEP) { argument 159 return llvm::EmitGEPOffset(&Builder, DL, GEP); 1138 /// is a sequence of GEP indices into the pointed type that will land us at the 1199 static bool shouldMergeGEPs(GEPOperator &GEP, GEPOperator &Src) { argument 1200 // If this GEP has only 0 indices, it is the same pointer as 1201 // Src. If Src is not a trivial GEP too, don't combine 1203 if (GEP.hasAllZeroIndices() && !Src.hasAllZeroIndices() && 1727 // At least one GEP must be inbounds. 1735 /// Thread a GEP operation with constant indices through the constant true/false 1737 static Instruction *foldSelectGEP(GetElementPtrInst &GEP, argument 1762 visitGetElementPtrInst(GetElementPtrInst &GEP) argument 2955 Value *GEP = Builder.CreateInBoundsGEP(L->getType(), local [all...] |
H A D | InstCombinePHI.cpp | 393 // This is true if all GEP bases are allocas and if all indices into them are 406 GetElementPtrInst *GEP= dyn_cast<GetElementPtrInst>(PN.getIncomingValue(i)); local 407 if (!GEP || !GEP->hasOneUse() || GEP->getType() != FirstInst->getType() || 408 GEP->getNumOperands() != FirstInst->getNumOperands()) 411 AllInBounds &= GEP->isInBounds(); 415 (!isa<AllocaInst>(GEP->getOperand(0)) || 416 !GEP->hasAllConstantIndices())) 421 if (FirstInst->getOperand(op) == GEP [all...] |
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Target/NVPTX/ |
H A D | NVVMReflect.cpp | 137 const ConstantExpr *GEP = cast<ConstantExpr>(Str); local 139 const Value *Sym = GEP->getOperand(0);
|
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Target/AMDGPU/ |
H A D | AMDGPUPerfHintAnalysis.cpp | 170 if (auto GEP = dyn_cast<GetElementPtrInst>(V)) { 171 auto P = GEP->getPointerOperand(); 173 for (unsigned I = 1, E = GEP->getNumIndices() + 1; I != E; ++I) 174 WorkSet.insert(GEP->getOperand(I)); 241 } else if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) { 243 auto *Ptr = GetPointerBaseWithConstantOffset(GEP, AM.BaseOffs, *DL); 246 if (TLI->isLegalAddressingMode(*DL, AM, GEP->getResultElementType(), 247 GEP->getPointerAddressSpace()))
|
H A D | AMDGPUPromoteAlloca.cpp | 358 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(stripBitcasts(Ptr)); local 359 if (!GEP) 362 auto I = GEPIdx.find(GEP); 366 static Value* GEPToVectorIndex(GetElementPtrInst *GEP) { argument 368 if (GEP->getNumOperands() != 3) 371 ConstantInt *I0 = dyn_cast<ConstantInt>(GEP->getOperand(1)); 375 return GEP->getOperand(2); 386 // Currently only handle the case where the Pointer Operand is a GEP. 406 // since it should be canonical form, the User should be a GEP. 476 GetElementPtrInst *GEP local [all...] |
H A D | AMDGPUInstructionSelector.h | 67 const MachineInstr &GEP; member in struct:llvm::AMDGPUInstructionSelector::GEPInfo 71 GEPInfo(const MachineInstr &GEP) : GEP(GEP), Imm(0) { } argument
|
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Target/ARM/ |
H A D | MVEGatherScatterLowering.cpp | 87 Value *checkGEP(Value *&Offsets, Type *Ty, GetElementPtrInst *GEP, 127 Value *Ptr, GetElementPtrInst *GEP, 171 GetElementPtrInst *GEP, 173 if (!GEP) { 180 Value *GEPPtr = GEP->getPointerOperand(); 184 if (GEP->getNumOperands() != 2) { 189 Offsets = GEP->getOperand(1); 427 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr); local 429 Value *BasePtr = checkGEP(Offsets, ResultTy, GEP, Builder); 434 Value *Load = tryCreateIncrementingGatScat(I, BasePtr, Offsets, GEP, Builde 170 checkGEP(Value *&Offsets, Type *Ty, GetElementPtrInst *GEP, IRBuilder<> &Builder) argument 567 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr); local 601 tryCreateIncrementingGatScat( IntrinsicInst *I, Value *BasePtr, Value *Offsets, GetElementPtrInst *GEP, IRBuilder<> &Builder) argument [all...] |
/freebsd-13-stable/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | Evaluator.cpp | 98 // GEP is fine if it is simple + constant offset. 128 /// globals and GEP's of globals. This should be kept up to date with 432 } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(CurInst)) { 433 Constant *P = getVal(GEP->getOperand(0)); 435 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); 439 ConstantExpr::getGetElementPtr(GEP->getSourceElementType(), P, GEPOps, 440 cast<GEPOperator>(GEP)->isInBounds()); 441 LLVM_DEBUG(dbgs() << "Found a GEP! Simplifying: " << *InstResult << "\n");
|
/freebsd-13-stable/contrib/llvm-project/llvm/lib/IR/ |
H A D | Value.cpp | 538 if (auto *GEP = dyn_cast<GEPOperator>(V)) { 544 if (!GEP->hasAllZeroIndices()) 548 if (!GEP->hasAllConstantIndices()) 552 if (!GEP->isInBounds()) 556 V = GEP->getPointerOperand(); 629 if (auto *GEP = dyn_cast<GEPOperator>(V)) { 631 if (!AllowNonInbounds && !GEP->isInBounds()) 635 // the pointer type of this GEP may be different from the type 638 // of GEP's pointer type rather than the size of the original 641 if (!GEP [all...] |
/freebsd-13-stable/contrib/llvm-project/llvm/lib/CodeGen/ |
H A D | InterleavedLoadCombinePass.cpp | 149 // Pa_3 = %IDX/2 + 1 #1 | GEP, step signext to i64 150 // Pa_4 = (%IDX/2)*16 + 16 #0 | GEP, multiply index by sizeof(4) for floats 151 // Pa_5 = (%IDX/2)*16 + 16 #0 | GEP, add offset of leading components 156 // Pb_3 = %IDX/2 + 2 #1 | GEP, step signext to i64 157 // Pb_4 = (%IDX/2)*16 + 32 #0 | GEP, multiply index by sizeof(4) for floats 158 // Pb_5 = (%IDX/2)*16 + 16 #0 | GEP, add offset of leading components 984 GetElementPtrInst &GEP = *cast<GetElementPtrInst>(&Ptr); local 989 if (GEP.accumulateConstantOffset(DL, BaseOffset)) { 991 BasePtr = GEP.getPointerOperand(); 994 // Otherwise we allow that the last index operand of the GEP i [all...] |