Home | History | Annotate | Download | only in CodeGen

Lines Matching refs:GEPI

6355 // For example, unmerge %GEPI and %UGEPI as below.
6362 // %GEPI = gep %GEPIOp, Idx
6365 // (* %GEPI is alive on the indirectbr edges due to other uses ahead)
6382 // (* %GEPI is still alive on the indirectbr edges)
6389 // %UGEPI = gep %GEPI, (UIdx-Idx)
6402 // (the path from %GEPIOp to %UGEPI would go through %GEPI), which is a tradeoff
6407 static bool tryUnmergingGEPsAcrossIndirectBr(GetElementPtrInst *GEPI,
6409 BasicBlock *SrcBlock = GEPI->getParent();
6414 // Check that GEPI is a simple gep with a single constant index.
6415 if (!GEPSequentialConstIndexed(GEPI))
6417 ConstantInt *GEPIIdx = cast<ConstantInt>(GEPI->getOperand(1));
6418 GEPI is a cheap one.
6422 Value *GEPIOp = GEPI->getOperand(0);
6431 if (find_if(GEPI->users(), [&](User *Usr) {
6438 }) == GEPI->users().end())
6445 if (Usr == GEPI) continue;
6483 // Now unmerge between GEPI and UGEPIs.
6485 UGEPI->setOperand(0, GEPI);
6491 // If GEPI is not inbounds but UGEPI is inbounds, change UGEPI to not
6493 if (!GEPI->isInBounds()) {
6607 if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(I)) {
6608 if (GEPI->hasAllZeroIndices()) {
6610 Instruction *NC = new BitCastInst(GEPI->getOperand(0), GEPI->getType(),
6611 GEPI->getName(), GEPI);
6612 NC->setDebugLoc(GEPI->getDebugLoc());
6613 GEPI->replaceAllUsesWith(NC);
6614 GEPI->eraseFromParent();
6619 if (tryUnmergingGEPsAcrossIndirectBr(GEPI, TTI)) {