/freebsd/contrib/llvm-project/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 | 228 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) in translateSubExpr() local 229 if (GEPI->getType() == GEP->getType() && in translateSubExpr() 230 GEPI->getSourceElementType() == GEP->getSourceElementType() && in translateSubExpr() 231 GEPI->getNumOperands() == GEPOps.size() && in translateSubExpr() 232 GEPI->getParent()->getParent() == CurBB->getParent() && in translateSubExpr() 233 (!DT || DT->dominates(GEPI->getParent(), PredBB))) { in translateSubExpr() 234 if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin())) in translateSubExpr() 235 return GEPI; in translateSubExpr()
|
H A D | InstructionSimplify.cpp | 7145 auto *GEPI = cast<GetElementPtrInst>(I); in simplifyInstructionWithOperands() local 7146 return simplifyGEPInst(GEPI->getSourceElementType(), NewOps[0], in simplifyInstructionWithOperands() 7147 ArrayRef(NewOps).slice(1), GEPI->getNoWrapFlags(), Q, in simplifyInstructionWithOperands()
|
H A D | ScalarEvolution.cpp | 3756 auto *GEPI = dyn_cast<Instruction>(GEP); in getGEPExpr() local 3757 if (!GEPI || !isSCEVExprNeverPoison(GEPI)) in getGEPExpr()
|
/freebsd/contrib/llvm-project/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()
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/ |
H A D | InstCombineLoadStoreAlloca.cpp | 891 GetElementPtrInst *GEPI, Instruction *MemI, in canReplaceGEPIdxWithZero() argument 893 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero() 898 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument 900 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero() 901 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero() 914 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero() 915 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero() 917 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero() 920 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero() 921 Type *SourceElementType = GEPI->getSourceElementType(); in canReplaceGEPIdxWithZero() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
H A D | Scalarizer.cpp | 302 bool visitGetElementPtrInst(GetElementPtrInst &GEPI); 811 bool ScalarizerVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument 812 std::optional<VectorSplit> VS = getVectorSplit(GEPI.getType()); in visitGetElementPtrInst() 816 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst() 817 unsigned NumIndices = GEPI.getNumIndices(); in visitGetElementPtrInst() 825 dyn_cast<FixedVectorType>(GEPI.getOperand(I)->getType())) { in visitGetElementPtrInst() 831 ScatterOps[I] = scatter(&GEPI, GEPI.getOperand(I), *OpVS); in visitGetElementPtrInst() 833 ScalarOps[I] = GEPI.getOperand(I); in visitGetElementPtrInst() 848 Res[I] = Builder.CreateGEP(GEPI.getSourceElementType(), SplitOps[0], in visitGetElementPtrInst() 850 GEPI.getName() + ".i" + Twine(I)); in visitGetElementPtrInst() [all …]
|
H A D | SROA.cpp | 1090 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument 1091 if (GEPI.use_empty()) in visitGetElementPtrInst() 1092 return markAsDead(GEPI); in visitGetElementPtrInst() 1094 return Base::visitGetElementPtrInst(GEPI); in visitGetElementPtrInst() 3940 bool unfoldGEPSelect(GetElementPtrInst &GEPI) { in unfoldGEPSelect() argument 3943 SelectInst *Sel = dyn_cast<SelectInst>(GEPI.getPointerOperand()); in unfoldGEPSelect() 3944 for (Value *Op : GEPI.indices()) { in unfoldGEPSelect() 3965 dbgs() << " " << GEPI << "\n";); in unfoldGEPSelect() 3969 for (Value *Op : GEPI.operands()) in unfoldGEPSelect() 3982 IRB.SetInsertPoint(&GEPI); in unfoldGEPSelect() [all …]
|
H A D | NewGVN.cpp | 1203 } else if (auto *GEPI = dyn_cast<GetElementPtrInst>(I)) { in createExpression() local 1204 Value *V = simplifyGEPInst(GEPI->getSourceElementType(), *E->op_begin(), in createExpression() 1206 GEPI->getNoWrapFlags(), Q); in createExpression()
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/IPO/ |
H A D | GlobalOpt.cpp | 678 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in AllUsesOfValueWillTrapIfNull() local 679 if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false; in AllUsesOfValueWillTrapIfNull() 797 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { in OptimizeAwayTrappingUsesOfValue() local 800 Idxs.reserve(GEPI->getNumOperands()-1); in OptimizeAwayTrappingUsesOfValue() 801 for (User::op_iterator i = GEPI->op_begin() + 1, e = GEPI->op_end(); in OptimizeAwayTrappingUsesOfValue() 807 if (Idxs.size() == GEPI->getNumOperands()-1) in OptimizeAwayTrappingUsesOfValue() 809 GEPI, ConstantExpr::getGetElementPtr(GEPI->getSourceElementType(), in OptimizeAwayTrappingUsesOfValue() 811 if (GEPI->use_empty()) { in OptimizeAwayTrappingUsesOfValue() 813 GEPI->eraseFromParent(); in OptimizeAwayTrappingUsesOfValue() 1058 if (auto *GEPI = dyn_cast<GetElementPtrInst>(U)) { in valueIsOnlyUsedLocallyOrStoredToOneGlobal() local [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/ |
H A D | SanitizerBinaryMetadata.cpp | 339 if (auto *GEPI = dyn_cast<GetElementPtrInst>(U)) { in hasUseAfterReturnUnsafeUses() local 340 if (!hasUseAfterReturnUnsafeUses(*GEPI)) in hasUseAfterReturnUnsafeUses()
|
H A D | DataFlowSanitizer.cpp | 804 void visitGetElementPtrInst(GetElementPtrInst &GEPI); 2794 void DFSanVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument 2797 StripPointerGEPsAndCasts(GEPI.getPointerOperand()))) { in visitGetElementPtrInst() 2798 visitInstOperands(GEPI); in visitGetElementPtrInst() 2804 Value *BasePointer = GEPI.getPointerOperand(); in visitGetElementPtrInst() 2805 DFSF.setShadow(&GEPI, DFSF.getShadow(BasePointer)); in visitGetElementPtrInst() 2807 DFSF.setOrigin(&GEPI, DFSF.getOrigin(BasePointer)); in visitGetElementPtrInst()
|
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/ |
H A D | CodeGenPrepare.cpp | 8127 static bool tryUnmergingGEPsAcrossIndirectBr(GetElementPtrInst *GEPI, in tryUnmergingGEPsAcrossIndirectBr() argument 8129 BasicBlock *SrcBlock = GEPI->getParent(); in tryUnmergingGEPsAcrossIndirectBr() 8135 if (!GEPSequentialConstIndexed(GEPI)) in tryUnmergingGEPsAcrossIndirectBr() 8137 ConstantInt *GEPIIdx = cast<ConstantInt>(GEPI->getOperand(1)); in tryUnmergingGEPsAcrossIndirectBr() 8143 Value *GEPIOp = GEPI->getOperand(0); in tryUnmergingGEPsAcrossIndirectBr() 8152 if (llvm::none_of(GEPI->users(), [&](User *Usr) { in tryUnmergingGEPsAcrossIndirectBr() 8166 if (Usr == GEPI) in tryUnmergingGEPsAcrossIndirectBr() 8186 if (UGEPI->getSourceElementType() != GEPI->getSourceElementType()) in tryUnmergingGEPsAcrossIndirectBr() 8211 UGEPI->setOperand(0, GEPI); in tryUnmergingGEPsAcrossIndirectBr() 8218 if (!GEPI->isInBounds()) { in tryUnmergingGEPsAcrossIndirectBr() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/ |
H A D | PromoteMemoryToRegister.cpp | 87 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in isAllocaPromotable() local 88 if (!GEPI->hasAllZeroIndices()) in isAllocaPromotable() 90 if (!onlyUsedByLifetimeMarkersOrDroppableInsts(GEPI)) in isAllocaPromotable()
|
/freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/ |
H A D | AMDGPUInstructionSelector.cpp | 4183 const GEPInfo &GEPI = AddrInfo[0]; in selectSmrdOffset() local 4187 EncodedImm = AMDGPU::getSMRDEncodedOffset(STI, GEPI.Imm, /*IsBuffer=*/false, in selectSmrdOffset() 4189 if (GEPI.SgprParts.size() == 1 && GEPI.Imm != 0 && EncodedImm && in selectSmrdOffset() 4216 EncodedImm = AMDGPU::getSMRDEncodedOffset(STI, GEPI.Imm, /*IsBuffer=*/false, in selectSmrdOffset() 4218 if (Offset && GEPI.SgprParts.size() == 1 && EncodedImm) { in selectSmrdOffset() 4219 Base = GEPI.SgprParts[0]; in selectSmrdOffset() 4225 if (SOffset && GEPI.SgprParts.size() == 1 && isUInt<32>(GEPI.Imm) && in selectSmrdOffset() 4226 GEPI.Imm != 0) { in selectSmrdOffset() 4231 Base = GEPI.SgprParts[0]; in selectSmrdOffset() 4234 .addImm(GEPI.Imm); in selectSmrdOffset() [all …]
|
/freebsd/contrib/llvm-project/llvm/lib/IR/ |
H A D | Instructions.cpp | 1465 GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI) in GetElementPtrInst() argument 1466 : Instruction(GEPI.getType(), GetElementPtr, in GetElementPtrInst() 1468 GEPI.getNumOperands(), in GetElementPtrInst() 1469 GEPI.getNumOperands()), in GetElementPtrInst() 1470 SourceElementType(GEPI.SourceElementType), in GetElementPtrInst() 1471 ResultElementType(GEPI.ResultElementType) { in GetElementPtrInst() 1472 std::copy(GEPI.op_begin(), GEPI.op_end(), op_begin()); in GetElementPtrInst() 1473 SubclassOptionalData = GEPI.SubclassOptionalData; in GetElementPtrInst()
|
/freebsd/contrib/llvm-project/llvm/lib/Target/SPIRV/ |
H A D | SPIRVEmitIntrinsics.cpp | 1142 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { in insertPtrCastOrAssignTypeInstr() local 1143 return replacePointerOperandWithPtrCast(I, GEPI->getPointerOperand(), in insertPtrCastOrAssignTypeInstr() 1144 GEPI->getSourceElementType(), 0, B); in insertPtrCastOrAssignTypeInstr()
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Coroutines/ |
H A D | CoroFrame.cpp | 1554 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() 1556 Base::visitGetElementPtrInst(GEPI); in visitGetElementPtrInst() 1557 handleAlias(GEPI); in visitGetElementPtrInst()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/IR/ |
H A D | Instructions.h | 919 GetElementPtrInst(const GetElementPtrInst &GEPI);
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Vectorize/ |
H A D | SLPVectorizer.cpp | 19061 auto *GEPI = GEPList[I]; in vectorizeGEPIndices() 19062 if (!Candidates.count(GEPI)) in vectorizeGEPIndices() 19069 Candidates.remove(GEPI); in vectorizeGEPIndices() 19071 } else if (GEPI->idx_begin()->get() == GEPJ->idx_begin()->get()) { in vectorizeGEPIndices() 19058 auto *GEPI = GEPList[I]; vectorizeGEPIndices() local
|