| /freebsd-14.2/contrib/llvm-project/llvm/lib/Target/BPF/ |
| H A D | BPFPreserveStaticOffset.cpp | 220 Args.append(GEP.Indices.begin(), GEP.Indices.end()); in fillCommonArgs() 282 auto *GEP = in reconstructGEP() local 286 return GEP; in reconstructGEP() 360 Info.Indices.append(GEP->idx_begin() + 1, GEP->idx_end()); in foldGEPChainAsStructAccess() 526 auto [GEP, Load] = in rewriteAccessChain() 528 GEPs.push_back(GEP); in rewriteAccessChain() 532 delete GEP; in rewriteAccessChain() 537 auto [GEP, Store] = in rewriteAccessChain() 539 GEPs.push_back(GEP); in rewriteAccessChain() 543 delete GEP; in rewriteAccessChain() [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
| H A D | SeparateConstOffsetFromGEP.cpp | 803 GEP->isInBounds()) in Find() 808 GetElementPtrInst *GEP) { in canonicalizeArrayIndicesToIndexSize() argument 812 for (User::op_iterator I = GEP->op_begin() + 1, E = GEP->op_end(); in canonicalizeArrayIndicesToIndexSize() 839 ConstantOffsetExtractor::Find(GEP->getOperand(I), GEP, DT); in accumulateByteOffset() 1061 GEP->setIsInBounds(false); in splitGEP() 1104 NewGEP->insertBefore(GEP); in splitGEP() 1107 IRBuilder<> Builder(GEP); in splitGEP() 1111 NewGEP->copyMetadata(*GEP); in splitGEP() 1113 GEP->replaceAllUsesWith(NewGEP); in splitGEP() 1114 GEP->eraseFromParent(); in splitGEP() [all …]
|
| H A D | NaryReassociate.cpp | 328 static bool isGEPFoldable(GetElementPtrInst *GEP, in isGEPFoldable() argument 331 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), in isGEPFoldable() 337 if (isGEPFoldable(GEP, TTI)) in tryReassociateGEP() 340 gep_type_iterator GTI = gep_type_begin(*GEP); in tryReassociateGEP() 362 SimplifyQuery SQ(*DL, DT, AC, GEP); in tryReassociateGEPAtIndex() 363 Value *IndexToSplit = GEP->getOperand(I + 1); in tryReassociateGEPAtIndex() 401 for (Use &Index : GEP->indices()) in tryReassociateGEPAtIndex() 423 IRBuilder<> Builder(GEP); in tryReassociateGEPAtIndex() 428 assert(Candidate->getType() == GEP->getType()); in tryReassociateGEPAtIndex() 461 NewGEP->setIsInBounds(GEP->isInBounds()); in tryReassociateGEPAtIndex() [all …]
|
| H A D | StraightLineStrengthReduce.cpp | 138 GEP, // &B[..][i * S][..] enumerator 284 return TTI->getGEPCost(GEP->getSourceElementType(), GEP->getPointerOperand(), in isGEPFoldable() 302 if (C.CandidateKind == Candidate::GEP) in isFoldable() 310 for (Use &Idx : GEP->indices()) { in hasOnlyOneNonZeroIndex() 327 if (C.CandidateKind == Candidate::GEP) { in isSimplestForm() 496 ArrayIdx, ElementSize, GEP); in factorArrayIndex() 525 GetElementPtrInst *GEP) { in allocateCandidatesAndFindBasisForGEP() argument 527 if (GEP->getType()->isVectorTy()) in allocateCandidatesAndFindBasisForGEP() 531 for (Use &Idx : GEP->indices()) in allocateCandidatesAndFindBasisForGEP() 545 Value *ArrayIdx = GEP->getOperand(I); in allocateCandidatesAndFindBasisForGEP() [all …]
|
| H A D | MergeICmps.cpp | 77 : GEP(GEP), LoadI(LoadI), BaseId(BaseId), Offset(Offset) {} in BCEAtom() 86 GEP = that.GEP; in operator =() 107 GetElementPtrInst *GEP = nullptr; member 165 if (GEP) { in visitICmpLoadOperand() 173 Base = GEP->getPointerOperand(); in visitICmpLoadOperand() 380 if (Result->Lhs.GEP) in visitCmpBlock() 381 BlockInsts.insert(Result->Lhs.GEP); in visitCmpBlock() 382 if (Result->Rhs.GEP) in visitCmpBlock() 383 BlockInsts.insert(Result->Rhs.GEP); in visitCmpBlock() 619 if (FirstCmp.Lhs().GEP) in mergeComparisons() [all …]
|
| H A D | LoopFlatten.cpp | 655 auto CheckGEP = [&](GetElementPtrInst *GEP, Value *GEPOperand) { in checkOverflow() argument 656 for (Value *GEPUser : GEP->users()) { in checkOverflow() 667 if (GEP->isInBounds() && in checkOverflow() 669 DL.getPointerTypeSizeInBits(GEP->getType())) { in checkOverflow() 672 GEP->dump()); in checkOverflow() 682 if (auto *GEP = dyn_cast<GetElementPtrInst>(V)) in checkOverflow() local 683 if (GEP->getNumIndices() == 1 && CheckGEP(GEP, GEP->getOperand(1))) in checkOverflow() 686 if (auto *GEP = dyn_cast<GetElementPtrInst>(U)) in checkOverflow() local 687 if (CheckGEP(GEP, V)) in checkOverflow() 794 if (auto *GEP = dyn_cast<GetElementPtrInst>(V)) { in DoFlattenLoopPair() local [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/IPO/ |
| H A D | GlobalSplit.cpp | 58 auto *GEP = dyn_cast<GEPOperator>(U); in splitGlobal() local 59 if (!GEP || !GEP->getInRangeIndex() || *GEP->getInRangeIndex() != 1 || in splitGlobal() 60 !isa<ConstantInt>(GEP->getOperand(1)) || in splitGlobal() 61 !cast<ConstantInt>(GEP->getOperand(1))->isZero() || in splitGlobal() 62 !isa<ConstantInt>(GEP->getOperand(2))) in splitGlobal() 118 auto *GEP = cast<GEPOperator>(U); in splitGlobal() local 119 unsigned I = cast<ConstantInt>(GEP->getOperand(2))->getZExtValue(); in splitGlobal() 125 for (unsigned I = 3; I != GEP->getNumOperands(); ++I) in splitGlobal() 126 Ops.push_back(GEP->getOperand(I)); in splitGlobal() 130 GEP->isInBounds()); in splitGlobal() [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/include/llvm/IR/ |
| H A D | GetElementPtrTypeIterator.h | 173 inline gep_type_iterator gep_type_begin(const User *GEP) { in gep_type_begin() argument 174 auto *GEPOp = cast<GEPOperator>(GEP); in gep_type_begin() 177 GEP->op_begin() + 1); in gep_type_begin() 180 inline gep_type_iterator gep_type_end(const User *GEP) { in gep_type_end() argument 181 return gep_type_iterator::end(GEP->op_end()); in gep_type_end() 184 inline gep_type_iterator gep_type_begin(const User &GEP) { in gep_type_begin() argument 185 auto &GEPOp = cast<GEPOperator>(GEP); in gep_type_begin() 188 GEP.op_begin() + 1); in gep_type_begin() 191 inline gep_type_iterator gep_type_end(const User &GEP) { in gep_type_end() argument 192 return gep_type_iterator::end(GEP.op_end()); in gep_type_end()
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
| H A D | RelLookupTableConverter.cpp | 36 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 …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Analysis/ |
| H A D | Local.cpp | 23 User *GEP, bool NoAssumptions) { in emitGEPOffset() argument 24 GEPOperator *GEPOp = cast<GEPOperator>(GEP); in emitGEPOffset() 25 Type *IntIdxTy = DL.getIndexType(GEP->getType()); in emitGEPOffset() 33 Result = Builder->CreateAdd(Result, Offset, GEP->getName() + ".offs", in emitGEPOffset() 39 gep_type_iterator GTI = gep_type_begin(GEP); in emitGEPOffset() 40 for (User::op_iterator i = GEP->op_begin() + 1, e = GEP->op_end(); i != e; in emitGEPOffset() 74 Op = Builder->CreateMul(Op, Scale, GEP->getName() + ".idx", false /*NUW*/, in emitGEPOffset()
|
| H A D | PHITransAddr.cpp | 200 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in translateSubExpr() local 203 for (Value *Op : GEP->operands()) { in translateSubExpr() 212 return GEP; in translateSubExpr() 215 if (Value *V = simplifyGEPInst(GEP->getSourceElementType(), GEPOps[0], in translateSubExpr() 217 GEP->isInBounds(), {DL, TLI, DT, AC})) { in translateSubExpr() 228 if (GEPI->getType() == GEP->getType() && in translateSubExpr() 229 GEPI->getSourceElementType() == GEP->getSourceElementType() && in translateSubExpr() 379 if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in insertTranslatedSubExpr() local 381 BasicBlock *CurBB = GEP->getParent(); in insertTranslatedSubExpr() 382 for (Value *Op : GEP->operands()) { in insertTranslatedSubExpr() [all …]
|
| H A D | TypeMetadataUtils.cpp | 61 } 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()
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Target/ARM/ |
| H A D | MVEGatherScatterLowering.cpp | 258 if (!GEP) { in decomposeGEP() 266 Offsets = GEP->getOperand(1); in decomposeGEP() 276 Offsets = GEP->getOperand(1); in decomposeGEP() 762 if (GEP->hasOneUse()) { in tryCreateIncrementingGatScat() 1186 Offsets = GEP->getOperand(1); in foldGEP() 1211 if (!GEP) in optimiseAddress() 1214 if (GEP->hasOneUse() && isa<GetElementPtrInst>(GEP->getPointerOperand())) { in optimiseAddress() 1232 "gep.merged", GEP); in optimiseAddress() 1235 GEP->replaceAllUsesWith( in optimiseAddress() 1237 GEP = NewAddress; in optimiseAddress() [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Target/RISCV/ |
| H A D | RISCVGatherScatterLowering.cpp | 342 auto *GEP = dyn_cast<GetElementPtrInst>(Ptr); in determineBaseAndStride() local 343 if (!GEP) in determineBaseAndStride() 346 auto I = StridedAddrs.find(GEP); in determineBaseAndStride() 350 SmallVector<Value *, 2> Ops(GEP->operands()); in determineBaseAndStride() 364 gep_type_iterator GTI = gep_type_begin(GEP); in determineBaseAndStride() 407 Builder.SetInsertPoint(GEP); in determineBaseAndStride() 424 StridedAddrs[GEP] = P; in determineBaseAndStride() 429 Loop *L = LI->getLoopFor(GEP->getParent()); in determineBaseAndStride() 443 Builder.SetInsertPoint(GEP); in determineBaseAndStride() 447 Type *SourceTy = GEP->getSourceElementType(); in determineBaseAndStride() [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/InstCombine/ |
| H A D | InstructionCombining.cpp | 2256 return &GEP; in visitGEPOfGEP() 2260 Indices.append(GEP.op_begin()+2, GEP.op_end()); in visitGEPOfGEP() 2266 Indices.append(GEP.idx_begin()+1, GEP.idx_end()); in visitGEPOfGEP() 2401 if (V != &GEP) in visitGetElementPtrInst() 2403 return &GEP; in visitGetElementPtrInst() 2421 for (User::op_iterator I = GEP.op_begin() + 1, E = GEP.op_end(); I != E; in visitGetElementPtrInst() 2452 return &GEP; in visitGetElementPtrInst() 2466 if (Op1 == &GEP) in visitGetElementPtrInst() 2478 if (Op2 == &GEP) in visitGetElementPtrInst() 2639 GEP.getResultElementType(), GEP.getPointerOperand(), in visitGetElementPtrInst() [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/include/llvm/Transforms/Scalar/ |
| H A D | NaryReassociate.h | 120 Instruction *tryReassociateGEP(GetElementPtrInst *GEP); 129 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP, 134 GetElementPtrInst *tryReassociateGEPAtIndex(GetElementPtrInst *GEP, 178 bool requiresSignExtension(Value *Index, GetElementPtrInst *GEP);
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Target/AMDGPU/ |
| H A D | AMDGPUPerfHintAnalysis.cpp | 163 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()
|
| H A D | AMDGPULowerModuleLDSPass.cpp | 1104 auto GEP = ConstantExpr::getGetElementPtr( in lowerDynamicLDSVariables() local 1460 Map[GV] = GEP; in createLDSVariableReplacement() 1500 Constant *GEP = Replacement.LDSVarsToConstantGEP.at(GV); in replaceLDSVariablesWithStruct() local 1502 GV->replaceUsesWithIf(GEP, Predicate); in replaceLDSVariablesWithStruct() 1504 APInt APOff(DL.getIndexTypeSizeInBits(GEP->getType()), 0); in replaceLDSVariablesWithStruct() 1505 GEP->stripAndAccumulateInBoundsConstantOffsets(DL, APOff); in replaceLDSVariablesWithStruct() 1518 refineUsesAlignmentAndAA(GEP, A, DL, AliasScope, NoAlias); in replaceLDSVariablesWithStruct() 1563 if (auto *GEP = dyn_cast<GetElementPtrInst>(U)) { in refineUsesAlignmentAndAA() local 1566 if (GEP->getPointerOperand() == Ptr) { in refineUsesAlignmentAndAA() 1568 if (GEP->accumulateConstantOffset(DL, Off)) in refineUsesAlignmentAndAA() [all …]
|
| H A D | AMDGPUPromoteAlloca.cpp | 292 if (!GEP) in calculateVectorIndex() 295 auto I = GEPIdx.find(GEP); in calculateVectorIndex() 304 unsigned BW = DL.getIndexTypeSizeInBits(GEP->getType()); in GEPToVectorIndex() 307 if (GEP->getPointerOperand()->stripPointerCasts() != Alloca || in GEPToVectorIndex() 308 !GEP->collectOffset(DL, BW, VarOffsets, ConstOffset)) in GEPToVectorIndex() 330 return ConstantInt::get(GEP->getContext(), Quot); in GEPToVectorIndex() 731 if (auto *GEP = dyn_cast<GetElementPtrInst>(Inst)) { in tryPromoteAllocaToVector() local 738 GEPVectorIdx[GEP] = Index; in tryPromoteAllocaToVector() 767 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr); in tryPromoteAllocaToVector() local 768 if (Ptr != &Alloca && !GEPVectorIdx.count(GEP)) in tryPromoteAllocaToVector() [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/IR/ |
| H A D | TypeFinder.cpp | 79 if (auto *GEP = dyn_cast<GetElementPtrInst>(&I)) in run() local 80 incorporateType(GEP->getSourceElementType()); in run() 160 if (auto *GEP = dyn_cast<GEPOperator>(V)) in incorporateValue() local 161 incorporateType(GEP->getSourceElementType()); in incorporateValue()
|
| H A D | ConstantFold.cpp | 438 if (auto *GEP = dyn_cast<GEPOperator>(CE)) { in ConstantFoldExtractElementInstruction() local 1469 if (PointeeTy != GEP->getResultElementType()) in foldGEPOfGEP() 1477 NewIndices.append(GEP->idx_begin(), GEP->idx_end()); in foldGEPOfGEP() 1480 GEP->getSourceElementType(), cast<Constant>(GEP->getPointerOperand()), in foldGEPOfGEP() 1481 NewIndices, InBounds && GEP->isInBounds(), GEP->getInRangeIndex()); in foldGEPOfGEP() 1484 gep_type_iterator LastI = gep_type_end(GEP); in foldGEPOfGEP() 1485 for (gep_type_iterator I = gep_type_begin(GEP), E = gep_type_end(GEP); in foldGEPOfGEP() 1499 auto *LastIdx = cast<Constant>(GEP->getOperand(GEP->getNumOperands()-1)); in foldGEPOfGEP() 1506 NewIndices.append(GEP->idx_begin(), GEP->idx_end() - 1); in foldGEPOfGEP() 1538 GEP->getSourceElementType(), cast<Constant>(GEP->getPointerOperand()), in foldGEPOfGEP() [all …]
|
| H A D | Value.cpp | 635 if (auto *GEP = dyn_cast<GEPOperator>(V)) { in stripPointerCastsAndOffsets() local 641 if (!GEP->hasAllZeroIndices()) in stripPointerCastsAndOffsets() 645 if (!GEP->hasAllConstantIndices()) in stripPointerCastsAndOffsets() 649 if (!GEP->isInBounds()) in stripPointerCastsAndOffsets() 653 V = GEP->getPointerOperand(); in stripPointerCastsAndOffsets() 730 if (auto *GEP = dyn_cast<GEPOperator>(V)) { in stripAndAccumulateConstantOffsets() local 732 if (!AllowNonInbounds && !GEP->isInBounds()) in stripAndAccumulateConstantOffsets() 765 V = GEP->getPointerOperand(); in stripAndAccumulateConstantOffsets() 997 gep_type_iterator GTI = gep_type_begin(GEP); in getOffsetFromIndex() 1003 for (unsigned i = Idx, e = GEP->getNumOperands(); i != e; ++i, ++GTI) { in getOffsetFromIndex() [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Target/DirectX/ |
| H A D | DXILPrepare.cpp | 154 if (auto GEP = dyn_cast<GetElementPtrInst>(&I)) { in runOnModule() local 156 Builder, PointerTypes, I, GEP->getPointerOperand(), in runOnModule() 157 GEP->getSourceElementType())) in runOnModule() 158 GEP->setOperand(0, NoOpBitcast); in runOnModule()
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Transforms/AggressiveInstCombine/ |
| H A D | AggressiveInstCombine.cpp | 538 GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(LI->getPointerOperand()); in tryToRecognizeTableBasedCttz() local 539 if (!GEP || !GEP->isInBounds() || GEP->getNumIndices() != 2) in tryToRecognizeTableBasedCttz() 542 if (!GEP->getSourceElementType()->isArrayTy()) in tryToRecognizeTableBasedCttz() 545 uint64_t ArraySize = GEP->getSourceElementType()->getArrayNumElements(); in tryToRecognizeTableBasedCttz() 549 GlobalVariable *GVTable = dyn_cast<GlobalVariable>(GEP->getPointerOperand()); in tryToRecognizeTableBasedCttz() 558 if (!match(GEP->idx_begin()->get(), m_ZeroInt())) in tryToRecognizeTableBasedCttz() 561 Value *Idx2 = std::next(GEP->idx_begin())->get(); in tryToRecognizeTableBasedCttz() 845 while (auto *GEP = dyn_cast<GEPOperator>(PtrOp)) { in getStrideAndModOffsetOfGEP() local 847 if (!GEP->collectOffset(DL, BW, VarOffsets, ModOffset)) in getStrideAndModOffsetOfGEP() 852 if (!GEP->isInBounds()) in getStrideAndModOffsetOfGEP() [all …]
|
| /freebsd-14.2/contrib/llvm-project/llvm/lib/Target/NVPTX/ |
| H A D | NVPTXLowerArgs.cpp | 184 if (auto *GEP = dyn_cast<GetElementPtrInst>(I.OldInstruction)) { in INITIALIZE_PASS_DEPENDENCY() local 185 SmallVector<Value *, 4> Indices(GEP->indices()); in INITIALIZE_PASS_DEPENDENCY() 186 auto *NewGEP = GetElementPtrInst::Create(GEP->getSourceElementType(), in INITIALIZE_PASS_DEPENDENCY() 188 GEP->getName(), GEP); in INITIALIZE_PASS_DEPENDENCY() 189 NewGEP->setIsInBounds(GEP->isInBounds()); in INITIALIZE_PASS_DEPENDENCY()
|