Home
last modified time | relevance | path

Searched refs:GEPI (Results 1 – 22 of 22) sorted by relevance

/freebsd/contrib/llvm-project/llvm/lib/Analysis/
H A DPtrUseVisitor.cpp32 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 DPHITransAddr.cpp231 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) in translateSubExpr() local
232 if (GEPI->getType() == GEP->getType() && in translateSubExpr()
233 GEPI->getSourceElementType() == GEP->getSourceElementType() && in translateSubExpr()
234 GEPI->getNumOperands() == GEPOps.size() && in translateSubExpr()
235 GEPI->getParent()->getParent() == CurBB->getParent() && in translateSubExpr()
236 (!DT || DT->dominates(GEPI->getParent(), PredBB))) { in translateSubExpr()
237 if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin())) in translateSubExpr()
238 return GEPI; in translateSubExpr()
H A DInstructionSimplify.cpp7187 auto *GEPI = cast<GetElementPtrInst>(I); in simplifyInstructionWithOperands() local
7188 return simplifyGEPInst(GEPI->getSourceElementType(), NewOps[0], in simplifyInstructionWithOperands()
7189 ArrayRef(NewOps).slice(1), GEPI->getNoWrapFlags(), Q, in simplifyInstructionWithOperands()
H A DScalarEvolution.cpp3738 auto *GEPI = dyn_cast<Instruction>(GEP); in getGEPExpr() local
3739 if (!GEPI || !isSCEVExprNeverPoison(GEPI)) in getGEPExpr()
/freebsd/contrib/llvm-project/llvm/include/llvm/Analysis/
H A DPtrUseVisitor.h177 bool adjustOffsetForGEP(GetElementPtrInst &GEPI);
272 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
273 if (GEPI.use_empty()) in visitGetElementPtrInst()
277 if (!adjustOffsetForGEP(GEPI)) { in visitGetElementPtrInst()
283 enqueueUsers(GEPI); in visitGetElementPtrInst()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/
H A DInstCombineLoadStoreAlloca.cpp899 GetElementPtrInst *GEPI, Instruction *MemI, in canReplaceGEPIdxWithZero() argument
901 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero()
906 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument
908 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero()
909 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero()
922 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero()
923 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero()
925 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero()
928 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero()
929 Type *SourceElementType = GEPI->getSourceElementType(); in canReplaceGEPIdxWithZero()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Target/DirectX/
H A DDXILDataScalarization.cpp70 bool visitGetElementPtrInst(GetElementPtrInst &GEPI);
303 bool DataScalarizerVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
304 Value *PtrOperand = GEPI.getPointerOperand(); in visitGetElementPtrInst()
305 Type *OrigGEPType = GEPI.getSourceElementType(); in visitGetElementPtrInst()
332 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst()
333 SmallVector<Value *, MaxVecSize> Indices(GEPI.indices()); in visitGetElementPtrInst()
336 GEPI.getName(), GEPI.getNoWrapFlags()); in visitGetElementPtrInst()
337 GEPI.replaceAllUsesWith(NewGEP); in visitGetElementPtrInst()
338 GEPI.eraseFromParent(); in visitGetElementPtrInst()
H A DDXILFlattenArrays.cpp60 bool visitGetElementPtrInst(GetElementPtrInst &GEPI);
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/
H A DScalarizer.cpp290 bool visitGetElementPtrInst(GetElementPtrInst &GEPI);
862 bool ScalarizerVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
863 std::optional<VectorSplit> VS = getVectorSplit(GEPI.getType()); in visitGetElementPtrInst()
867 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst()
868 unsigned NumIndices = GEPI.getNumIndices(); in visitGetElementPtrInst()
876 dyn_cast<FixedVectorType>(GEPI.getOperand(I)->getType())) { in visitGetElementPtrInst()
882 ScatterOps[I] = scatter(&GEPI, GEPI.getOperand(I), *OpVS); in visitGetElementPtrInst()
884 ScalarOps[I] = GEPI.getOperand(I); in visitGetElementPtrInst()
899 Res[I] = Builder.CreateGEP(GEPI.getSourceElementType(), SplitOps[0], in visitGetElementPtrInst()
901 GEPI.getName() + ".i" + Twine(I)); in visitGetElementPtrInst()
[all …]
H A DSROA.cpp1095 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
1096 if (GEPI.use_empty()) in visitGetElementPtrInst()
1097 return markAsDead(GEPI); in visitGetElementPtrInst()
1099 return Base::visitGetElementPtrInst(GEPI); in visitGetElementPtrInst()
4063 bool unfoldGEPSelect(GetElementPtrInst &GEPI) { in unfoldGEPSelect() argument
4066 Instruction *Sel = dyn_cast<SelectInst>(GEPI.getPointerOperand()); in unfoldGEPSelect()
4067 for (Value *Op : GEPI.indices()) { in unfoldGEPSelect()
4096 dbgs() << " " << GEPI << "\n";); in unfoldGEPSelect()
4100 for (Value *Op : GEPI.operands()) in unfoldGEPSelect()
4121 IRB.SetInsertPoint(&GEPI); in unfoldGEPSelect()
[all …]
H A DNewGVN.cpp1240 } else if (auto *GEPI = dyn_cast<GetElementPtrInst>(I)) { in createExpression() local
1241 Value *V = simplifyGEPInst(GEPI->getSourceElementType(), *E->op_begin(), in createExpression()
1243 GEPI->getNoWrapFlags(), Q); in createExpression()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/IPO/
H A DGlobalOpt.cpp685 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in AllUsesOfValueWillTrapIfNull() local
686 if (!AllUsesOfValueWillTrapIfNull(GEPI, PHIs)) return false; in AllUsesOfValueWillTrapIfNull()
808 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { in OptimizeAwayTrappingUsesOfValue() local
811 Idxs.reserve(GEPI->getNumOperands()-1); in OptimizeAwayTrappingUsesOfValue()
812 for (User::op_iterator i = GEPI->op_begin() + 1, e = GEPI->op_end(); in OptimizeAwayTrappingUsesOfValue()
818 if (Idxs.size() == GEPI->getNumOperands()-1) in OptimizeAwayTrappingUsesOfValue()
820 GEPI, ConstantExpr::getGetElementPtr(GEPI->getSourceElementType(), in OptimizeAwayTrappingUsesOfValue()
822 if (GEPI->use_empty()) { in OptimizeAwayTrappingUsesOfValue()
824 GEPI->eraseFromParent(); in OptimizeAwayTrappingUsesOfValue()
1070 if (auto *GEPI = dyn_cast<GetElementPtrInst>(U)) { in valueIsOnlyUsedLocallyOrStoredToOneGlobal() local
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Coroutines/
H A DSpillUtils.cpp260 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst()
262 Base::visitGetElementPtrInst(GEPI); in visitGetElementPtrInst()
263 handleAlias(GEPI); in visitGetElementPtrInst()
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Instrumentation/
H A DSanitizerBinaryMetadata.cpp340 if (auto *GEPI = dyn_cast<GetElementPtrInst>(U)) { in hasUseAfterReturnUnsafeUses() local
341 if (!hasUseAfterReturnUnsafeUses(*GEPI)) in hasUseAfterReturnUnsafeUses()
H A DDataFlowSanitizer.cpp804 void visitGetElementPtrInst(GetElementPtrInst &GEPI);
2784 void DFSanVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
2787 StripPointerGEPsAndCasts(GEPI.getPointerOperand()))) { in visitGetElementPtrInst()
2788 visitInstOperands(GEPI); in visitGetElementPtrInst()
2794 Value *BasePointer = GEPI.getPointerOperand(); in visitGetElementPtrInst()
2795 DFSF.setShadow(&GEPI, DFSF.getShadow(BasePointer)); in visitGetElementPtrInst()
2797 DFSF.setOrigin(&GEPI, DFSF.getOrigin(BasePointer)); in visitGetElementPtrInst()
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/
H A DCodeGenPrepare.cpp8519 static bool tryUnmergingGEPsAcrossIndirectBr(GetElementPtrInst *GEPI, in tryUnmergingGEPsAcrossIndirectBr() argument
8521 BasicBlock *SrcBlock = GEPI->getParent(); in tryUnmergingGEPsAcrossIndirectBr()
8527 if (!GEPSequentialConstIndexed(GEPI)) in tryUnmergingGEPsAcrossIndirectBr()
8529 ConstantInt *GEPIIdx = cast<ConstantInt>(GEPI->getOperand(1)); in tryUnmergingGEPsAcrossIndirectBr()
8535 Value *GEPIOp = GEPI->getOperand(0); in tryUnmergingGEPsAcrossIndirectBr()
8544 if (llvm::none_of(GEPI->users(), [&](User *Usr) { in tryUnmergingGEPsAcrossIndirectBr()
8558 if (Usr == GEPI) in tryUnmergingGEPsAcrossIndirectBr()
8578 if (UGEPI->getSourceElementType() != GEPI->getSourceElementType()) in tryUnmergingGEPsAcrossIndirectBr()
8603 UGEPI->setOperand(0, GEPI); in tryUnmergingGEPsAcrossIndirectBr()
8610 if (!GEPI->isInBounds()) { in tryUnmergingGEPsAcrossIndirectBr()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Utils/
H A DPromoteMemoryToRegister.cpp89 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in isAllocaPromotable() local
90 if (!GEPI->hasAllZeroIndices()) in isAllocaPromotable()
92 if (!onlyUsedByLifetimeMarkersOrDroppableInsts(GEPI)) in isAllocaPromotable()
/freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/
H A DAMDGPUInstructionSelector.cpp5217 const GEPInfo &GEPI = AddrInfo[0]; in selectSmrdOffset() local
5221 EncodedImm = AMDGPU::getSMRDEncodedOffset(STI, GEPI.Imm, /*IsBuffer=*/false, in selectSmrdOffset()
5223 if (GEPI.SgprParts.size() == 1 && GEPI.Imm != 0 && EncodedImm && in selectSmrdOffset()
5250 EncodedImm = AMDGPU::getSMRDEncodedOffset(STI, GEPI.Imm, /*IsBuffer=*/false, in selectSmrdOffset()
5252 if (Offset && GEPI.SgprParts.size() == 1 && EncodedImm) { in selectSmrdOffset()
5253 Base = GEPI.SgprParts[0]; in selectSmrdOffset()
5259 if (SOffset && GEPI.SgprParts.size() == 1 && isUInt<32>(GEPI.Imm) && in selectSmrdOffset()
5260 GEPI.Imm != 0) { in selectSmrdOffset()
5265 Base = GEPI.SgprParts[0]; in selectSmrdOffset()
5268 .addImm(GEPI.Imm); in selectSmrdOffset()
[all …]
/freebsd/contrib/llvm-project/llvm/lib/IR/
H A DInstructions.cpp1532 GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI, in GetElementPtrInst() argument
1534 : Instruction(GEPI.getType(), GetElementPtr, AllocInfo), in GetElementPtrInst()
1535 SourceElementType(GEPI.SourceElementType), in GetElementPtrInst()
1536 ResultElementType(GEPI.ResultElementType) { in GetElementPtrInst()
1537 assert(getNumOperands() == GEPI.getNumOperands() && in GetElementPtrInst()
1539 std::copy(GEPI.op_begin(), GEPI.op_end(), op_begin()); in GetElementPtrInst()
1540 SubclassOptionalData = GEPI.SubclassOptionalData; in GetElementPtrInst()
/freebsd/contrib/llvm-project/llvm/lib/Target/SPIRV/
H A DSPIRVEmitIntrinsics.cpp1589 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { in insertPtrCastOrAssignTypeInstr() local
1590 Value *Pointer = GEPI->getPointerOperand(); in insertPtrCastOrAssignTypeInstr()
1591 Type *OpTy = GEPI->getSourceElementType(); in insertPtrCastOrAssignTypeInstr()
/freebsd/contrib/llvm-project/llvm/include/llvm/IR/
H A DInstructions.h953 GetElementPtrInst(const GetElementPtrInst &GEPI, AllocInfo AllocInfo);
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Vectorize/
H A DSLPVectorizer.cpp24642 auto *GEPI = GEPList[I]; in vectorizeGEPIndices() local
24643 if (!Candidates.count(GEPI)) in vectorizeGEPIndices()
24650 Candidates.remove(GEPI); in vectorizeGEPIndices()
24652 } else if (GEPI->idx_begin()->get() == GEPJ->idx_begin()->get()) { in vectorizeGEPIndices()