Lines Matching defs:GEPI
8364 // For example, unmerge %GEPI and %UGEPI as below.
8371 // %GEPI = gep %GEPIOp, Idx
8374 // (* %GEPI is alive on the indirectbr edges due to other uses ahead)
8391 // (* %GEPI is still alive on the indirectbr edges)
8398 // %UGEPI = gep %GEPI, (UIdx-Idx)
8411 // (the path from %GEPIOp to %UGEPI would go through %GEPI), which is a tradeoff
8416 static bool tryUnmergingGEPsAcrossIndirectBr(GetElementPtrInst *GEPI,
8418 BasicBlock *SrcBlock = GEPI->getParent();
8423 // Check that GEPI is a simple gep with a single constant index.
8424 if (!GEPSequentialConstIndexed(GEPI))
8426 ConstantInt *GEPIIdx = cast<ConstantInt>(GEPI->getOperand(1));
8427 // Check that GEPI is a cheap one.
8432 Value *GEPIOp = GEPI->getOperand(0);
8441 if (llvm::none_of(GEPI->users(), [&](User *Usr) {
8455 if (Usr == GEPI)
8475 if (UGEPI->getSourceElementType() != GEPI->getSourceElementType())
8498 // Now unmerge between GEPI and UGEPIs.
8500 UGEPI->setOperand(0, GEPI);
8505 // If GEPI is not inbounds but UGEPI is inbounds, change UGEPI to not
8507 if (!GEPI->isInBounds()) {
8699 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
8700 if (GEPI->hasAllZeroIndices()) {
8702 Instruction *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(),
8703 GEPI->getName(), GEPI->getIterator());
8704 NC->setDebugLoc(GEPI->getDebugLoc());
8705 replaceAllUsesWith(GEPI, NC, FreshBBs, IsHugeFunc);
8707 GEPI, TLInfo, nullptr,
8713 if (tryUnmergingGEPsAcrossIndirectBr(GEPI, TTI)) {