Home
last modified time | relevance | path

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

/external/llvm/lib/Transforms/InstCombine/
DInstCombineLoadStoreAlloca.cpp665 static bool canReplaceGEPIdxWithZero(InstCombiner &IC, GetElementPtrInst *GEPI, in canReplaceGEPIdxWithZero() argument
667 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero()
672 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument
674 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero()
675 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero()
688 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero()
689 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero()
691 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero()
694 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero()
696 cast<PointerType>(GEPI->getOperand(0)->getType()->getScalarType()) in canReplaceGEPIdxWithZero()
[all …]
/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/llvm/lib/Transforms/IPO/
DGlobalOpt.cpp378 GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I); in isSafeSROAElementUse() local
379 if (!GEPI) return false; in isSafeSROAElementUse()
381 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) || in isSafeSROAElementUse()
382 !cast<Constant>(GEPI->getOperand(1))->isNullValue()) in isSafeSROAElementUse()
385 for (User *U : GEPI->users()) in isSafeSROAElementUse()
410 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U); in IsUserOfGlobalSafeForSRA() local
411 ++GEPI; // Skip over the pointer index. in IsUserOfGlobalSafeForSRA()
414 if (ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) { in IsUserOfGlobalSafeForSRA()
431 for (++GEPI; // Skip array index. in IsUserOfGlobalSafeForSRA()
432 GEPI != E; in IsUserOfGlobalSafeForSRA()
[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.cpp242 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) in PHITranslateSubExpr() local
243 if (GEPI->getType() == GEP->getType() && 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()
/external/llvm/lib/Transforms/Scalar/
DScalarizer.cpp436 bool Scalarizer::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
437 VectorType *VT = dyn_cast<VectorType>(GEPI.getType()); in visitGetElementPtrInst()
441 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst()
443 unsigned NumIndices = GEPI.getNumIndices(); in visitGetElementPtrInst()
445 Scatterer Base = scatter(&GEPI, GEPI.getOperand(0)); in visitGetElementPtrInst()
450 Ops[I] = scatter(&GEPI, GEPI.getOperand(I + 1)); in visitGetElementPtrInst()
459 Res[I] = Builder.CreateGEP(GEPI.getSourceElementType(), Base[I], Indices, in visitGetElementPtrInst()
460 GEPI.getName() + ".i" + Twine(I)); in visitGetElementPtrInst()
461 if (GEPI.isInBounds()) in visitGetElementPtrInst()
465 gather(&GEPI, Res); in visitGetElementPtrInst()
DScalarReplAggregates.cpp158 void isSafeGEP(GetElementPtrInst *GEPI, uint64_t &Offset, AllocaInfo &Info);
175 void RewriteGEP(GetElementPtrInst *GEPI, AllocaInst *AI, uint64_t Offset,
1618 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(User)) { in isSafeForScalarRepl() local
1620 isSafeGEP(GEPI, GEPOffset, Info); in isSafeForScalarRepl()
1622 isSafeForScalarRepl(GEPI, GEPOffset, Info); in isSafeForScalarRepl()
1684 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(UI)) { in isSafePHISelectUseForScalarRepl() local
1688 if (!GEPI->hasAllZeroIndices()) in isSafePHISelectUseForScalarRepl()
1690 isSafePHISelectUseForScalarRepl(GEPI, Offset, Info); in isSafePHISelectUseForScalarRepl()
1722 void SROA::isSafeGEP(GetElementPtrInst *GEPI, in isSafeGEP() argument
1724 gep_type_iterator GEPIt = gep_type_begin(GEPI), E = gep_type_end(GEPI); in isSafeGEP()
[all …]
DSROA.cpp687 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
688 if (GEPI.use_empty()) in visitGetElementPtrInst()
689 return markAsDead(GEPI); in visitGetElementPtrInst()
691 if (SROAStrictInbounds && GEPI.isInBounds()) { in visitGetElementPtrInst()
700 const DataLayout &DL = GEPI.getModule()->getDataLayout(); in visitGetElementPtrInst()
701 for (gep_type_iterator GTI = gep_type_begin(GEPI), in visitGetElementPtrInst()
702 GTE = gep_type_end(GEPI); in visitGetElementPtrInst()
726 return markAsDead(GEPI); in visitGetElementPtrInst()
730 return Base::visitGetElementPtrInst(GEPI); in visitGetElementPtrInst()
3154 bool visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
[all …]
/external/llvm/lib/Target/NVPTX/
DNVPTXFavorNonGenericAddrSpaces.cpp158 if (Instruction *GEPI = dyn_cast<Instruction>(GEP)) { in hoistAddrSpaceCastFromGEP() local
165 "", GEPI); in hoistAddrSpaceCastFromGEP()
167 NewASC = new AddrSpaceCastInst(NewGEP, GEP->getType(), "", GEPI); in hoistAddrSpaceCastFromGEP()
/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/llvm/lib/IR/
DInstructions.cpp1519 GetElementPtrInst::GetElementPtrInst(const GetElementPtrInst &GEPI) in GetElementPtrInst() argument
1520 : Instruction(GEPI.getType(), GetElementPtr, in GetElementPtrInst()
1522 GEPI.getNumOperands(), in GetElementPtrInst()
1523 GEPI.getNumOperands()), in GetElementPtrInst()
1524 SourceElementType(GEPI.SourceElementType), in GetElementPtrInst()
1525 ResultElementType(GEPI.ResultElementType) { in GetElementPtrInst()
1526 std::copy(GEPI.op_begin(), GEPI.op_end(), op_begin()); in GetElementPtrInst()
1527 SubclassOptionalData = GEPI.SubclassOptionalData; in GetElementPtrInst()
DConstants.cpp1121 gep_type_iterator GEPI = gep_type_begin(this), E = gep_type_end(this); in isGEPWithNoNotionalOverIndexing() local
1125 ++GEPI; in isGEPWithNoNotionalOverIndexing()
1130 for (; GEPI != E; ++GEPI, ++OI) { in isGEPWithNoNotionalOverIndexing()
1133 if (ArrayType *ATy = dyn_cast<ArrayType>(*GEPI)) in isGEPWithNoNotionalOverIndexing()
/external/llvm/lib/CodeGen/
DCodeGenPrepare.cpp5181 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { in optimizeInst() local
5182 if (GEPI->hasAllZeroIndices()) { in optimizeInst()
5184 Instruction *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(), in optimizeInst()
5185 GEPI->getName(), GEPI); in optimizeInst()
5186 GEPI->replaceAllUsesWith(NC); in optimizeInst()
5187 GEPI->eraseFromParent(); in optimizeInst()
/external/llvm/lib/Transforms/Instrumentation/
DDataFlowSanitizer.cpp339 void visitGetElementPtrInst(GetElementPtrInst &GEPI);
1281 void DFSanVisitor::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument
1282 visitOperandShadowInst(GEPI); in visitGetElementPtrInst()
/external/llvm/include/llvm/IR/
DInstructions.h844 GetElementPtrInst(const GetElementPtrInst &GEPI);