Home
last modified time | relevance | path

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

12

/external/llvm/lib/Transforms/IPO/
DGlobalOpt.cpp337 GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I); in isSafeSROAElementUse() local
338 if (!GEPI) return false; in isSafeSROAElementUse()
340 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) || in isSafeSROAElementUse()
341 !cast<Constant>(GEPI->getOperand(1))->isNullValue()) in isSafeSROAElementUse()
344 for (User *U : GEPI->users()) in isSafeSROAElementUse()
369 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U); in IsUserOfGlobalSafeForSRA() local
370 ++GEPI; // Skip over the pointer index. in IsUserOfGlobalSafeForSRA()
373 if (ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) { in IsUserOfGlobalSafeForSRA()
390 for (++GEPI; // Skip array index. in IsUserOfGlobalSafeForSRA()
391 GEPI != E; in IsUserOfGlobalSafeForSRA()
[all …]
/external/llvm-project/llvm/lib/Analysis/
DPtrUseVisitor.cpp33 bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) { in adjustOffsetForGEP() argument
37 APInt TmpOffset(DL.getIndexTypeSizeInBits(GEPI.getType()), 0); in adjustOffsetForGEP()
38 if (GEPI.accumulateConstantOffset(DL, TmpOffset)) { in adjustOffsetForGEP()
DPHITransAddr.cpp240 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) in PHITranslateSubExpr() local
241 if (GEPI->getType() == GEP->getType() && in PHITranslateSubExpr()
242 GEPI->getNumOperands() == GEPOps.size() && in PHITranslateSubExpr()
243 GEPI->getParent()->getParent() == CurBB->getParent() && in PHITranslateSubExpr()
244 (!DT || DT->dominates(GEPI->getParent(), PredBB))) { in PHITranslateSubExpr()
245 if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin())) in PHITranslateSubExpr()
246 return GEPI; in PHITranslateSubExpr()
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Analysis/
DPtrUseVisitor.cpp33 bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) { in adjustOffsetForGEP() argument
37 APInt TmpOffset(DL.getIndexTypeSizeInBits(GEPI.getType()), 0); in adjustOffsetForGEP()
38 if (GEPI.accumulateConstantOffset(DL, TmpOffset)) { in adjustOffsetForGEP()
DPHITransAddr.cpp240 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) in PHITranslateSubExpr() local
241 if (GEPI->getType() == GEP->getType() && in PHITranslateSubExpr()
242 GEPI->getNumOperands() == GEPOps.size() && in PHITranslateSubExpr()
243 GEPI->getParent()->getParent() == CurBB->getParent() && in PHITranslateSubExpr()
244 (!DT || DT->dominates(GEPI->getParent(), PredBB))) { in PHITranslateSubExpr()
245 if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin())) in PHITranslateSubExpr()
246 return GEPI; in PHITranslateSubExpr()
/external/llvm/include/llvm/Analysis/
DPtrUseVisitor.h163 bool adjustOffsetForGEP(GetElementPtrInst &GEPI);
246 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
247 if (GEPI.use_empty()) in visitGetElementPtrInst()
251 if (!adjustOffsetForGEP(GEPI)) { in visitGetElementPtrInst()
257 enqueueUsers(GEPI); in visitGetElementPtrInst()
/external/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Analysis/
DPtrUseVisitor.h175 bool adjustOffsetForGEP(GetElementPtrInst &GEPI);
267 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
268 if (GEPI.use_empty()) in visitGetElementPtrInst()
272 if (!adjustOffsetForGEP(GEPI)) { in visitGetElementPtrInst()
278 enqueueUsers(GEPI); in visitGetElementPtrInst()
/external/llvm-project/llvm/include/llvm/Analysis/
DPtrUseVisitor.h174 bool adjustOffsetForGEP(GetElementPtrInst &GEPI);
266 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
267 if (GEPI.use_empty()) in visitGetElementPtrInst()
271 if (!adjustOffsetForGEP(GEPI)) { in visitGetElementPtrInst()
277 enqueueUsers(GEPI); in visitGetElementPtrInst()
/external/llvm/lib/Transforms/InstCombine/
DInstCombineLoadStoreAlloca.cpp700 static bool canReplaceGEPIdxWithZero(InstCombiner &IC, GetElementPtrInst *GEPI, in canReplaceGEPIdxWithZero() argument
702 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero()
707 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument
709 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero()
710 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero()
723 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero()
724 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero()
726 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero()
729 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero()
731 GetElementPtrInst::getIndexedType(GEPI->getSourceElementType(), Ops); in canReplaceGEPIdxWithZero()
[all …]
/external/llvm-project/llvm/lib/Transforms/InstCombine/
DInstCombineLoadStoreAlloca.cpp813 GetElementPtrInst *GEPI, Instruction *MemI, in canReplaceGEPIdxWithZero() argument
815 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero()
820 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument
822 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero()
823 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero()
836 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero()
837 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero()
839 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero()
842 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero()
843 Type *SourceElementType = GEPI->getSourceElementType(); in canReplaceGEPIdxWithZero()
[all …]
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/InstCombine/
DInstCombineLoadStoreAlloca.cpp847 static bool canReplaceGEPIdxWithZero(InstCombiner &IC, GetElementPtrInst *GEPI, in canReplaceGEPIdxWithZero() argument
849 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero()
854 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument
856 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero()
857 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero()
870 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero()
871 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero()
873 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero()
876 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero()
878 GetElementPtrInst::getIndexedType(GEPI->getSourceElementType(), Ops); in canReplaceGEPIdxWithZero()
[all …]
/external/llvm-project/llvm/lib/Transforms/IPO/
DGlobalOpt.cpp380 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U); in isSafeSROAGEP() local
381 ++GEPI; // Skip over the pointer index. in isSafeSROAGEP()
388 for (; GEPI != E; ++GEPI) { in isSafeSROAGEP()
389 if (GEPI.isStruct()) in isSafeSROAGEP()
392 ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand()); in isSafeSROAGEP()
393 if (!IdxVal || (GEPI.isBoundedSequential() && in isSafeSROAGEP()
394 IdxVal->getZExtValue() >= GEPI.getSequentialNumElements())) in isSafeSROAGEP()
617 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP); in SRAGlobal() local
620 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) in SRAGlobal()
621 Idxs.push_back(GEPI->getOperand(i)); in SRAGlobal()
[all …]
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/IPO/
DGlobalOpt.cpp375 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U); in isSafeSROAGEP() local
376 ++GEPI; // Skip over the pointer index. in isSafeSROAGEP()
383 for (; GEPI != E; ++GEPI) { in isSafeSROAGEP()
384 if (GEPI.isStruct()) in isSafeSROAGEP()
387 ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand()); in isSafeSROAGEP()
388 if (!IdxVal || (GEPI.isBoundedSequential() && in isSafeSROAGEP()
389 IdxVal->getZExtValue() >= GEPI.getSequentialNumElements())) in isSafeSROAGEP()
598 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP); in SRAGlobal() local
601 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) in SRAGlobal()
602 Idxs.push_back(GEPI->getOperand(i)); in SRAGlobal()
[all …]
/external/llvm/lib/Analysis/
DPtrUseVisitor.cpp30 bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) { in adjustOffsetForGEP() argument
34 return GEPI.accumulateConstantOffset(DL, Offset); in adjustOffsetForGEP()
DPHITransAddr.cpp243 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) in PHITranslateSubExpr() local
244 if (GEPI->getType() == GEP->getType() && in PHITranslateSubExpr()
245 GEPI->getNumOperands() == GEPOps.size() && in PHITranslateSubExpr()
246 GEPI->getParent()->getParent() == CurBB->getParent() && in PHITranslateSubExpr()
247 (!DT || DT->dominates(GEPI->getParent(), PredBB))) { in PHITranslateSubExpr()
248 if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin())) in PHITranslateSubExpr()
249 return GEPI; in PHITranslateSubExpr()
/external/llvm/lib/Transforms/Scalar/
DScalarizer.cpp439 bool Scalarizer::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
440 VectorType *VT = dyn_cast<VectorType>(GEPI.getType()); in visitGetElementPtrInst()
444 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst()
446 unsigned NumIndices = GEPI.getNumIndices(); in visitGetElementPtrInst()
448 Scatterer Base = scatter(&GEPI, GEPI.getOperand(0)); in visitGetElementPtrInst()
453 Ops[I] = scatter(&GEPI, GEPI.getOperand(I + 1)); in visitGetElementPtrInst()
462 Res[I] = Builder.CreateGEP(GEPI.getSourceElementType(), Base[I], Indices, in visitGetElementPtrInst()
463 GEPI.getName() + ".i" + Twine(I)); in visitGetElementPtrInst()
464 if (GEPI.isInBounds()) in visitGetElementPtrInst()
468 gather(&GEPI, Res); in visitGetElementPtrInst()
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/Scalar/
DScalarizer.cpp192 bool visitGetElementPtrInst(GetElementPtrInst &GEPI);
618 bool ScalarizerVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
619 VectorType *VT = dyn_cast<VectorType>(GEPI.getType()); in visitGetElementPtrInst()
623 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst()
625 unsigned NumIndices = GEPI.getNumIndices(); in visitGetElementPtrInst()
629 Value *Op0 = GEPI.getOperand(0); in visitGetElementPtrInst()
632 Scatterer Base = scatter(&GEPI, Op0); in visitGetElementPtrInst()
637 Value *Op = GEPI.getOperand(I + 1); in visitGetElementPtrInst()
644 Ops[I] = scatter(&GEPI, Op); in visitGetElementPtrInst()
654 Res[I] = Builder.CreateGEP(GEPI.getSourceElementType(), Base[I], Indices, in visitGetElementPtrInst()
[all …]
/external/llvm-project/llvm/lib/Transforms/Scalar/
DScalarizer.cpp198 bool visitGetElementPtrInst(GetElementPtrInst &GEPI);
630 bool ScalarizerVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
631 VectorType *VT = dyn_cast<VectorType>(GEPI.getType()); in visitGetElementPtrInst()
635 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst()
637 unsigned NumIndices = GEPI.getNumIndices(); in visitGetElementPtrInst()
641 Value *Op0 = GEPI.getOperand(0); in visitGetElementPtrInst()
644 Scatterer Base = scatter(&GEPI, Op0); in visitGetElementPtrInst()
649 Value *Op = GEPI.getOperand(I + 1); in visitGetElementPtrInst()
656 Ops[I] = scatter(&GEPI, Op); in visitGetElementPtrInst()
666 Res[I] = Builder.CreateGEP(GEPI.getSourceElementType(), Base[I], Indices, in visitGetElementPtrInst()
[all …]
DSROA.cpp722 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
723 if (GEPI.use_empty()) in visitGetElementPtrInst()
724 return markAsDead(GEPI); in visitGetElementPtrInst()
726 if (SROAStrictInbounds && GEPI.isInBounds()) { in visitGetElementPtrInst()
735 const DataLayout &DL = GEPI.getModule()->getDataLayout(); in visitGetElementPtrInst()
736 for (gep_type_iterator GTI = gep_type_begin(GEPI), in visitGetElementPtrInst()
737 GTE = gep_type_end(GEPI); in visitGetElementPtrInst()
763 return markAsDead(GEPI); in visitGetElementPtrInst()
767 return Base::visitGetElementPtrInst(GEPI); in visitGetElementPtrInst()
3478 bool foldGEPSelect(GetElementPtrInst &GEPI) { in foldGEPSelect() argument
[all …]
/external/llvm/lib/Target/NVPTX/
DNVPTXFavorNonGenericAddrSpaces.cpp161 if (Instruction *GEPI = dyn_cast<Instruction>(GEP)) { in hoistAddrSpaceCastFromGEP() local
168 "", GEPI); in hoistAddrSpaceCastFromGEP()
171 NewASC = new AddrSpaceCastInst(NewGEP, GEP->getType(), "", GEPI); in hoistAddrSpaceCastFromGEP()
/external/llvm-project/llvm/unittests/IR/
DInstructionsTest.cpp754 auto *GEPI = cast<GetElementPtrInst>(V); in TEST() local
755 ASSERT_NE(GEPI->idx_begin(), GEPI->idx_end()); in TEST()
756 ASSERT_EQ(GEPI->idx_end(), std::next(GEPI->idx_begin(), 3)); in TEST()
757 EXPECT_EQ(Indices[0], GEPI->idx_begin()[0]); in TEST()
758 EXPECT_EQ(Indices[1], GEPI->idx_begin()[1]); in TEST()
759 EXPECT_EQ(Indices[2], GEPI->idx_begin()[2]); in TEST()
760 EXPECT_EQ(GEPI->idx_begin(), GEPI->indices().begin()); in TEST()
761 EXPECT_EQ(GEPI->idx_end(), GEPI->indices().end()); in TEST()
763 const auto *CGEPI = GEPI; in TEST()
772 delete GEPI; in TEST()
/external/llvm/lib/Transforms/Utils/
DPromoteMemoryToRegister.cpp79 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in isAllocaPromotable() local
80 if (GEPI->getType() != Type::getInt8PtrTy(U->getContext(), AS)) in isAllocaPromotable()
82 if (!GEPI->hasAllZeroIndices()) in isAllocaPromotable()
84 if (!onlyUsedByLifetimeMarkers(GEPI)) in isAllocaPromotable()
/external/swiftshader/third_party/llvm-10.0/llvm/lib/Transforms/Utils/
DPromoteMemoryToRegister.cpp91 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in isAllocaPromotable() local
92 if (GEPI->getType() != Type::getInt8PtrTy(U->getContext(), AS)) in isAllocaPromotable()
94 if (!GEPI->hasAllZeroIndices()) in isAllocaPromotable()
96 if (!onlyUsedByLifetimeMarkers(GEPI)) in isAllocaPromotable()
/external/llvm-project/llvm/lib/Transforms/Utils/
DPromoteMemoryToRegister.cpp85 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in isAllocaPromotable() local
86 if (!GEPI->hasAllZeroIndices()) in isAllocaPromotable()
88 if (!onlyUsedByLifetimeMarkersOrDroppableInsts(GEPI)) in isAllocaPromotable()
/external/swiftshader/third_party/llvm-10.0/llvm/lib/CodeGen/
DCodeGenPrepare.cpp6950 static bool tryUnmergingGEPsAcrossIndirectBr(GetElementPtrInst *GEPI, in tryUnmergingGEPsAcrossIndirectBr() argument
6952 BasicBlock *SrcBlock = GEPI->getParent(); in tryUnmergingGEPsAcrossIndirectBr()
6958 if (!GEPSequentialConstIndexed(GEPI)) in tryUnmergingGEPsAcrossIndirectBr()
6960 ConstantInt *GEPIIdx = cast<ConstantInt>(GEPI->getOperand(1)); in tryUnmergingGEPsAcrossIndirectBr()
6965 Value *GEPIOp = GEPI->getOperand(0); in tryUnmergingGEPsAcrossIndirectBr()
6974 if (find_if(GEPI->users(), [&](User *Usr) { in tryUnmergingGEPsAcrossIndirectBr()
6981 }) == GEPI->users().end()) in tryUnmergingGEPsAcrossIndirectBr()
6988 if (Usr == GEPI) continue; in tryUnmergingGEPsAcrossIndirectBr()
7028 UGEPI->setOperand(0, GEPI); in tryUnmergingGEPsAcrossIndirectBr()
7036 if (!GEPI->isInBounds()) { in tryUnmergingGEPsAcrossIndirectBr()
[all …]

12