| /llvm-project-15.0.7/llvm/lib/Analysis/ |
| H A D | PtrUseVisitor.cpp | 32 bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) { in adjustOffsetForGEP() argument 36 APInt TmpOffset(DL.getIndexTypeSizeInBits(GEPI.getType()), 0); in adjustOffsetForGEP() 37 if (GEPI.accumulateConstantOffset(DL, TmpOffset)) { in adjustOffsetForGEP()
|
| H A D | PHITransAddr.cpp | 241 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) in PHITranslateSubExpr() local 242 if (GEPI->getType() == GEP->getType() && in PHITranslateSubExpr() 243 GEPI->getSourceElementType() == GEP->getSourceElementType() && in PHITranslateSubExpr() 244 GEPI->getNumOperands() == GEPOps.size() && in PHITranslateSubExpr() 245 GEPI->getParent()->getParent() == CurBB->getParent() && in PHITranslateSubExpr() 246 (!DT || DT->dominates(GEPI->getParent(), PredBB))) { in PHITranslateSubExpr() 247 if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin())) in PHITranslateSubExpr() 248 return GEPI; in PHITranslateSubExpr()
|
| H A D | InstructionSimplify.cpp | 6386 auto *GEPI = cast<GetElementPtrInst>(I); in simplifyInstructionWithOperands() local 6388 simplifyGEPInst(GEPI->getSourceElementType(), NewOps[0], in simplifyInstructionWithOperands() 6389 makeArrayRef(NewOps).slice(1), GEPI->isInBounds(), Q); in simplifyInstructionWithOperands()
|
| H A D | ScalarEvolution.cpp | 3682 auto *GEPI = dyn_cast<Instruction>(GEP); in getGEPExpr() local 3685 return GEPI && isSCEVExprNeverPoison(GEPI); in getGEPExpr()
|
| /llvm-project-15.0.7/llvm/include/llvm/Analysis/ |
| H A D | PtrUseVisitor.h | 167 bool adjustOffsetForGEP(GetElementPtrInst &GEPI); 259 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument 260 if (GEPI.use_empty()) in visitGetElementPtrInst() 264 if (!adjustOffsetForGEP(GEPI)) { in visitGetElementPtrInst() 270 enqueueUsers(GEPI); in visitGetElementPtrInst()
|
| /llvm-project-15.0.7/llvm/lib/Transforms/InstCombine/ |
| H A D | InstCombineLoadStoreAlloca.cpp | 814 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero() 822 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero() 835 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero() 836 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero() 838 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero() 841 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero() 874 if (Idx+1 != GEPI->getNumOperands() && !GEPI->isInBounds()) in canReplaceGEPIdxWithZero() 892 Instruction *NewGEPI = GEPI->clone(); in replaceGEPIdxWithZero() 895 NewGEPI->insertBefore(GEPI); in replaceGEPIdxWithZero() 910 Ptr = GEPI->getOperand(0); in canSimplifyNullStoreOrGEP() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Scalar/ |
| H A D | Scalarizer.cpp | 218 bool visitGetElementPtrInst(GetElementPtrInst &GEPI); 679 VectorType *VT = dyn_cast<VectorType>(GEPI.getType()); in visitGetElementPtrInst() 683 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst() 685 unsigned NumIndices = GEPI.getNumIndices(); in visitGetElementPtrInst() 689 Value *Op0 = GEPI.getOperand(0); in visitGetElementPtrInst() 692 Scatterer Base = scatter(&GEPI, Op0); in visitGetElementPtrInst() 697 Value *Op = GEPI.getOperand(I + 1); in visitGetElementPtrInst() 704 Ops[I] = scatter(&GEPI, Op); in visitGetElementPtrInst() 715 GEPI.getName() + ".i" + Twine(I)); in visitGetElementPtrInst() 716 if (GEPI.isInBounds()) in visitGetElementPtrInst() [all …]
|
| H A D | SROA.cpp | 716 if (GEPI.use_empty()) in visitGetElementPtrInst() 717 return markAsDead(GEPI); in visitGetElementPtrInst() 756 return markAsDead(GEPI); in visitGetElementPtrInst() 3481 IRB.SetInsertPoint(&GEPI); in foldGEPSelect() 3497 Visited.erase(&GEPI); in foldGEPSelect() 3499 GEPI.eraseFromParent(); in foldGEPSelect() 3553 Visited.erase(&GEPI); in foldGEPPhi() 3555 GEPI.eraseFromParent(); in foldGEPPhi() 3568 foldGEPSelect(GEPI)) in visitGetElementPtrInst() 3572 foldGEPPhi(GEPI)) in visitGetElementPtrInst() [all …]
|
| H A D | NewGVN.cpp | 1205 } else if (auto *GEPI = dyn_cast<GetElementPtrInst>(I)) { in createExpression() local 1207 simplifyGEPInst(GEPI->getSourceElementType(), *E->op_begin(), in createExpression() 1209 GEPI->isInBounds(), Q); in createExpression()
|
| /llvm-project-15.0.7/llvm/unittests/IR/ |
| H A D | InstructionsTest.cpp | 876 auto *GEPI = cast<GetElementPtrInst>(V); in TEST() local 877 ASSERT_NE(GEPI->idx_begin(), GEPI->idx_end()); in TEST() 878 ASSERT_EQ(GEPI->idx_end(), std::next(GEPI->idx_begin(), 3)); in TEST() 879 EXPECT_EQ(Indices[0], GEPI->idx_begin()[0]); in TEST() 880 EXPECT_EQ(Indices[1], GEPI->idx_begin()[1]); in TEST() 881 EXPECT_EQ(Indices[2], GEPI->idx_begin()[2]); in TEST() 882 EXPECT_EQ(GEPI->idx_begin(), GEPI->indices().begin()); in TEST() 883 EXPECT_EQ(GEPI->idx_end(), GEPI->indices().end()); in TEST() 885 const auto *CGEPI = GEPI; in TEST() 894 delete GEPI; in TEST()
|
| /llvm-project-15.0.7/llvm/lib/Transforms/IPO/ |
| H A D | GlobalOpt.cpp | 622 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in AllUsesOfValueWillTrapIfNull() local 623 if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false; in AllUsesOfValueWillTrapIfNull() 742 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { in OptimizeAwayTrappingUsesOfValue() local 745 Idxs.reserve(GEPI->getNumOperands()-1); in OptimizeAwayTrappingUsesOfValue() 746 for (User::op_iterator i = GEPI->op_begin() + 1, e = GEPI->op_end(); in OptimizeAwayTrappingUsesOfValue() 752 if (Idxs.size() == GEPI->getNumOperands()-1) in OptimizeAwayTrappingUsesOfValue() 754 GEPI, ConstantExpr::getGetElementPtr(GEPI->getSourceElementType(), in OptimizeAwayTrappingUsesOfValue() 756 if (GEPI->use_empty()) { in OptimizeAwayTrappingUsesOfValue() 758 GEPI->eraseFromParent(); in OptimizeAwayTrappingUsesOfValue() 1022 if (auto *GEPI = dyn_cast<GetElementPtrInst>(U)) { in valueIsOnlyUsedLocallyOrStoredToOneGlobal() local [all …]
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Utils/ |
| H A D | PromoteMemoryToRegister.cpp | 85 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in isAllocaPromotable() local 86 if (!GEPI->hasAllZeroIndices()) in isAllocaPromotable() 88 if (!onlyUsedByLifetimeMarkersOrDroppableInsts(GEPI)) in isAllocaPromotable()
|
| /llvm-project-15.0.7/llvm/lib/CodeGen/ |
| H A D | CodeGenPrepare.cpp | 7735 if (!GEPSequentialConstIndexed(GEPI)) in tryUnmergingGEPsAcrossIndirectBr() 7743 Value *GEPIOp = GEPI->getOperand(0); in tryUnmergingGEPsAcrossIndirectBr() 7759 }) == GEPI->users().end()) in tryUnmergingGEPsAcrossIndirectBr() 7766 if (Usr == GEPI) continue; in tryUnmergingGEPsAcrossIndirectBr() 7808 UGEPI->setOperand(0, GEPI); in tryUnmergingGEPsAcrossIndirectBr() 7816 if (!GEPI->isInBounds()) { in tryUnmergingGEPsAcrossIndirectBr() 7989 if (GEPI->hasAllZeroIndices()) { in optimizeInst() 7991 Instruction *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(), in optimizeInst() 7992 GEPI->getName(), GEPI); in optimizeInst() 7994 GEPI->replaceAllUsesWith(NC); in optimizeInst() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Target/AMDGPU/ |
| H A D | AMDGPUInstructionSelector.cpp | 3852 const GEPInfo &GEPI = AddrInfo[0]; in selectSmrdOffset() local 3854 AMDGPU::getSMRDEncodedOffset(STI, GEPI.Imm, false); in selectSmrdOffset() 3857 if (GEPI.SgprParts.size() == 1 && GEPI.Imm != 0 && EncodedImm && in selectSmrdOffset() 3873 if (Offset && GEPI.SgprParts.size() == 1 && EncodedImm) { in selectSmrdOffset() 3874 Base = GEPI.SgprParts[0]; in selectSmrdOffset() 3880 if (SOffset && GEPI.SgprParts.size() == 1 && isUInt<32>(GEPI.Imm) && in selectSmrdOffset() 3881 GEPI.Imm != 0) { in selectSmrdOffset() 3886 Base = GEPI.SgprParts[0]; in selectSmrdOffset() 3889 .addImm(GEPI.Imm); in selectSmrdOffset() 3893 if (SOffset && GEPI.SgprParts.size() && GEPI.Imm == 0) { in selectSmrdOffset() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Instrumentation/ |
| H A D | DataFlowSanitizer.cpp | 760 void visitGetElementPtrInst(GetElementPtrInst &GEPI); 2586 void DFSanVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument 2589 StripPointerGEPsAndCasts(GEPI.getPointerOperand()))) { in visitGetElementPtrInst() 2590 visitInstOperands(GEPI); in visitGetElementPtrInst() 2596 Value *BasePointer = GEPI.getPointerOperand(); in visitGetElementPtrInst() 2597 DFSF.setShadow(&GEPI, DFSF.getShadow(BasePointer)); in visitGetElementPtrInst() 2599 DFSF.setOrigin(&GEPI, DFSF.getOrigin(BasePointer)); in visitGetElementPtrInst()
|
| /llvm-project-15.0.7/llvm/lib/IR/ |
| H A D | Instructions.cpp | 1742 GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI) in GetElementPtrInst() argument 1743 : Instruction(GEPI.getType(), GetElementPtr, in GetElementPtrInst() 1745 GEPI.getNumOperands(), in GetElementPtrInst() 1746 GEPI.getNumOperands()), in GetElementPtrInst() 1747 SourceElementType(GEPI.SourceElementType), in GetElementPtrInst() 1748 ResultElementType(GEPI.ResultElementType) { in GetElementPtrInst() 1749 std::copy(GEPI.op_begin(), GEPI.op_end(), op_begin()); in GetElementPtrInst() 1750 SubclassOptionalData = GEPI.SubclassOptionalData; in GetElementPtrInst()
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Coroutines/ |
| H A D | CoroFrame.cpp | 1375 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() 1377 Base::visitGetElementPtrInst(GEPI); in visitGetElementPtrInst() 1378 handleAlias(GEPI); in visitGetElementPtrInst()
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Vectorize/ |
| H A D | SLPVectorizer.cpp | 12321 auto *GEPI = GEPList[I]; in vectorizeGEPIndices() local 12322 if (!Candidates.count(GEPI)) in vectorizeGEPIndices() 12329 Candidates.remove(GEPI); in vectorizeGEPIndices() 12331 } else if (GEPI->idx_begin()->get() == GEPJ->idx_begin()->get()) { in vectorizeGEPIndices()
|
| /llvm-project-15.0.7/llvm/include/llvm/IR/ |
| H A D | Instructions.h | 933 GetElementPtrInst(const GetElementPtrInst &GEPI);
|