/external/llvm/lib/Transforms/IPO/ |
D | GlobalOpt.cpp | 337 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/swiftshader/third_party/LLVM/lib/Transforms/IPO/ |
D | GlobalOpt.cpp | 397 GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I); in isSafeSROAElementUse() local 398 if (GEPI == 0) return false; in isSafeSROAElementUse() 400 if (GEPI->getNumOperands() < 3 || !isa<Constant>(GEPI->getOperand(1)) || in isSafeSROAElementUse() 401 !cast<Constant>(GEPI->getOperand(1))->isNullValue()) in isSafeSROAElementUse() 404 for (Value::use_iterator I = GEPI->use_begin(), E = GEPI->use_end(); in isSafeSROAElementUse() 431 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U); in IsUserOfGlobalSafeForSRA() local 432 ++GEPI; // Skip over the pointer index. in IsUserOfGlobalSafeForSRA() 435 if (ArrayType *AT = dyn_cast<ArrayType>(*GEPI)) { in IsUserOfGlobalSafeForSRA() 452 for (++GEPI; // Skip array index. in IsUserOfGlobalSafeForSRA() 453 GEPI != E; in IsUserOfGlobalSafeForSRA() [all …]
|
/external/swiftshader/third_party/llvm-7.0/llvm/include/llvm/Analysis/ |
D | PtrUseVisitor.h | 176 bool adjustOffsetForGEP(GetElementPtrInst &GEPI); 264 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument 265 if (GEPI.use_empty()) in visitGetElementPtrInst() 269 if (!adjustOffsetForGEP(GEPI)) { in visitGetElementPtrInst() 275 enqueueUsers(GEPI); in visitGetElementPtrInst()
|
/external/llvm/include/llvm/Analysis/ |
D | PtrUseVisitor.h | 163 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/InstCombine/ |
D | InstCombineLoadStoreAlloca.cpp | 700 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/swiftshader/third_party/llvm-7.0/llvm/lib/Transforms/IPO/ |
D | GlobalOpt.cpp | 373 gep_type_iterator GEPI = gep_type_begin(U), E = gep_type_end(U); in isSafeSROAGEP() local 374 ++GEPI; // Skip over the pointer index. in isSafeSROAGEP() 381 for (; GEPI != E; ++GEPI) { in isSafeSROAGEP() 382 if (GEPI.isStruct()) in isSafeSROAGEP() 385 ConstantInt *IdxVal = dyn_cast<ConstantInt>(GEPI.getOperand()); in isSafeSROAGEP() 386 if (!IdxVal || (GEPI.isBoundedSequential() && in isSafeSROAGEP() 387 IdxVal->getZExtValue() >= GEPI.getSequentialNumElements())) in isSafeSROAGEP() 576 GetElementPtrInst *GEPI = cast<GetElementPtrInst>(GEP); in SRAGlobal() local 579 for (unsigned i = 3, e = GEPI->getNumOperands(); i != e; ++i) in SRAGlobal() 580 Idxs.push_back(GEPI->getOperand(i)); in SRAGlobal() [all …]
|
/external/swiftshader/third_party/llvm-7.0/llvm/lib/Transforms/InstCombine/ |
D | InstCombineLoadStoreAlloca.cpp | 879 static bool canReplaceGEPIdxWithZero(InstCombiner &IC, GetElementPtrInst *GEPI, in canReplaceGEPIdxWithZero() argument 881 if (GEPI->getNumOperands() < 2) in canReplaceGEPIdxWithZero() 886 auto FirstNZIdx = [](const GetElementPtrInst *GEPI) { in canReplaceGEPIdxWithZero() argument 888 for (unsigned IE = GEPI->getNumOperands(); I != IE; ++I) { in canReplaceGEPIdxWithZero() 889 Value *V = GEPI->getOperand(I); in canReplaceGEPIdxWithZero() 902 Idx = FirstNZIdx(GEPI); in canReplaceGEPIdxWithZero() 903 if (Idx == GEPI->getNumOperands()) in canReplaceGEPIdxWithZero() 905 if (isa<Constant>(GEPI->getOperand(Idx))) in canReplaceGEPIdxWithZero() 908 SmallVector<Value *, 4> Ops(GEPI->idx_begin(), GEPI->idx_begin() + Idx); in canReplaceGEPIdxWithZero() 910 GetElementPtrInst::getIndexedType(GEPI->getSourceElementType(), Ops); in canReplaceGEPIdxWithZero() [all …]
|
/external/swiftshader/third_party/llvm-7.0/llvm/lib/Transforms/Scalar/ |
D | Scalarizer.cpp | 173 bool visitGetElementPtrInst(GetElementPtrInst &GEPI); 544 bool Scalarizer::visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument 545 VectorType *VT = dyn_cast<VectorType>(GEPI.getType()); in visitGetElementPtrInst() 549 IRBuilder<> Builder(&GEPI); in visitGetElementPtrInst() 551 unsigned NumIndices = GEPI.getNumIndices(); in visitGetElementPtrInst() 555 Value *Op0 = GEPI.getOperand(0); in visitGetElementPtrInst() 558 Scatterer Base = scatter(&GEPI, Op0); in visitGetElementPtrInst() 563 Value *Op = GEPI.getOperand(I + 1); in visitGetElementPtrInst() 570 Ops[I] = scatter(&GEPI, Op); in visitGetElementPtrInst() 580 Res[I] = Builder.CreateGEP(GEPI.getSourceElementType(), Base[I], Indices, in visitGetElementPtrInst() [all …]
|
/external/llvm/lib/Transforms/Scalar/ |
D | Scalarizer.cpp | 439 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()
|
D | SROA.cpp | 674 void visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument 675 if (GEPI.use_empty()) in visitGetElementPtrInst() 676 return markAsDead(GEPI); in visitGetElementPtrInst() 678 if (SROAStrictInbounds && GEPI.isInBounds()) { in visitGetElementPtrInst() 687 const DataLayout &DL = GEPI.getModule()->getDataLayout(); in visitGetElementPtrInst() 688 for (gep_type_iterator GTI = gep_type_begin(GEPI), in visitGetElementPtrInst() 689 GTE = gep_type_end(GEPI); in visitGetElementPtrInst() 713 return markAsDead(GEPI); in visitGetElementPtrInst() 717 return Base::visitGetElementPtrInst(GEPI); in visitGetElementPtrInst() 3143 bool visitGetElementPtrInst(GetElementPtrInst &GEPI) { in visitGetElementPtrInst() argument [all …]
|
/external/swiftshader/third_party/llvm-7.0/llvm/lib/Analysis/ |
D | PHITransAddr.cpp | 241 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) in PHITranslateSubExpr() local 242 if (GEPI->getType() == GEP->getType() && in PHITranslateSubExpr() 243 GEPI->getNumOperands() == GEPOps.size() && in PHITranslateSubExpr() 244 GEPI->getParent()->getParent() == CurBB->getParent() && in PHITranslateSubExpr() 245 (!DT || DT->dominates(GEPI->getParent(), PredBB))) { in PHITranslateSubExpr() 246 if (std::equal(GEPOps.begin(), GEPOps.end(), GEPI->op_begin())) in PHITranslateSubExpr() 247 return GEPI; in PHITranslateSubExpr()
|
D | PtrUseVisitor.cpp | 34 bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) { in adjustOffsetForGEP() argument 38 return GEPI.accumulateConstantOffset(DL, Offset); in adjustOffsetForGEP()
|
/external/swiftshader/third_party/LLVM/lib/Analysis/ |
D | PHITransAddr.cpp | 242 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*UI)) 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() 249 if (GEPI->getOperand(i) != GEPOps[i]) { in PHITranslateSubExpr() 254 return GEPI; in PHITranslateSubExpr()
|
D | InlineCost.cpp | 120 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(II)){ in analyzeBasicBlock() local 123 if (GEPI->hasAllConstantIndices()) in analyzeBasicBlock()
|
/external/llvm/lib/Analysis/ |
D | PHITransAddr.cpp | 243 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()
|
D | PtrUseVisitor.cpp | 30 bool detail::PtrUseVisitorBase::adjustOffsetForGEP(GetElementPtrInst &GEPI) { in adjustOffsetForGEP() argument 34 return GEPI.accumulateConstantOffset(DL, Offset); in adjustOffsetForGEP()
|
/external/swiftshader/third_party/LLVM/lib/Transforms/Scalar/ |
D | ScalarReplAggregates.cpp | 130 void isSafeGEP(GetElementPtrInst *GEPI, uint64_t &Offset, AllocaInfo &Info); 146 void RewriteGEP(GetElementPtrInst *GEPI, AllocaInst *AI, uint64_t Offset, 1512 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(User)) { in isSafeForScalarRepl() local 1514 isSafeGEP(GEPI, GEPOffset, Info); in isSafeForScalarRepl() 1516 isSafeForScalarRepl(GEPI, GEPOffset, Info); in isSafeForScalarRepl() 1576 } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(User)) { in isSafePHISelectUseForScalarRepl() local 1580 if (!GEPI->hasAllZeroIndices()) in isSafePHISelectUseForScalarRepl() 1582 isSafePHISelectUseForScalarRepl(GEPI, Offset, Info); in isSafePHISelectUseForScalarRepl() 1614 void SROA::isSafeGEP(GetElementPtrInst *GEPI, in isSafeGEP() argument 1616 gep_type_iterator GEPIt = gep_type_begin(GEPI), E = gep_type_end(GEPI); in isSafeGEP() [all …]
|
D | CodeGenPrepare.cpp | 1109 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) { in OptimizeInst() local 1110 if (GEPI->hasAllZeroIndices()) { in OptimizeInst() 1112 Instruction *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(), in OptimizeInst() 1113 GEPI->getName(), GEPI); in OptimizeInst() 1114 GEPI->replaceAllUsesWith(NC); in OptimizeInst() 1115 GEPI->eraseFromParent(); in OptimizeInst()
|
/external/swiftshader/third_party/llvm-7.0/llvm/unittests/IR/ |
D | InstructionsTest.cpp | 670 auto *GEPI = cast<GetElementPtrInst>(V); in TEST() local 671 ASSERT_NE(GEPI->idx_begin(), GEPI->idx_end()); in TEST() 672 ASSERT_EQ(GEPI->idx_end(), std::next(GEPI->idx_begin(), 3)); in TEST() 673 EXPECT_EQ(Indices[0], GEPI->idx_begin()[0]); in TEST() 674 EXPECT_EQ(Indices[1], GEPI->idx_begin()[1]); in TEST() 675 EXPECT_EQ(Indices[2], GEPI->idx_begin()[2]); in TEST() 676 EXPECT_EQ(GEPI->idx_begin(), GEPI->indices().begin()); in TEST() 677 EXPECT_EQ(GEPI->idx_end(), GEPI->indices().end()); in TEST() 679 const auto *CGEPI = GEPI; in TEST() 688 delete GEPI; in TEST()
|
/external/llvm/lib/Target/NVPTX/ |
D | NVPTXFavorNonGenericAddrSpaces.cpp | 161 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/swiftshader/third_party/LLVM/lib/Transforms/InstCombine/ |
D | InstCombineLoadStoreAlloca.cpp | 178 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(Op)) { in visitLoadInst() local 179 const Value *GEPI0 = GEPI->getOperand(0); in visitLoadInst() 181 if (isa<ConstantPointerNull>(GEPI0) && GEPI->getPointerAddressSpace() == 0){ in visitLoadInst()
|
/external/llvm/lib/Transforms/Utils/ |
D | PromoteMemoryToRegister.cpp | 79 } 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-7.0/llvm/lib/Transforms/Utils/ |
D | PromoteMemoryToRegister.cpp | 93 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in isAllocaPromotable() local 94 if (GEPI->getType() != Type::getInt8PtrTy(U->getContext(), AS)) in isAllocaPromotable() 96 if (!GEPI->hasAllZeroIndices()) in isAllocaPromotable() 98 if (!onlyUsedByLifetimeMarkers(GEPI)) in isAllocaPromotable()
|
/external/swiftshader/third_party/LLVM/lib/Transforms/Utils/ |
D | PromoteMemoryToRegister.cpp | 109 } else if (const GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(U)) { in isAllocaPromotable() local 110 if (GEPI->getType() != Type::getInt8PtrTy(U->getContext())) in isAllocaPromotable() 112 if (!GEPI->hasAllZeroIndices()) in isAllocaPromotable() 114 if (!onlyUsedByLifetimeMarkers(GEPI)) in isAllocaPromotable()
|
/external/swiftshader/third_party/llvm-7.0/llvm/lib/CodeGen/ |
D | CodeGenPrepare.cpp | 6407 static bool tryUnmergingGEPsAcrossIndirectBr(GetElementPtrInst *GEPI, in tryUnmergingGEPsAcrossIndirectBr() argument 6409 BasicBlock *SrcBlock = GEPI->getParent(); in tryUnmergingGEPsAcrossIndirectBr() 6415 if (!GEPSequentialConstIndexed(GEPI)) in tryUnmergingGEPsAcrossIndirectBr() 6417 ConstantInt *GEPIIdx = cast<ConstantInt>(GEPI->getOperand(1)); in tryUnmergingGEPsAcrossIndirectBr() 6422 Value *GEPIOp = GEPI->getOperand(0); in tryUnmergingGEPsAcrossIndirectBr() 6431 if (find_if(GEPI->users(), [&](User *Usr) { in tryUnmergingGEPsAcrossIndirectBr() 6438 }) == GEPI->users().end()) in tryUnmergingGEPsAcrossIndirectBr() 6445 if (Usr == GEPI) continue; in tryUnmergingGEPsAcrossIndirectBr() 6485 UGEPI->setOperand(0, GEPI); in tryUnmergingGEPsAcrossIndirectBr() 6493 if (!GEPI->isInBounds()) { in tryUnmergingGEPsAcrossIndirectBr() [all …]
|