• Home
  • Raw
  • Download

Lines Matching refs:ICI

547     ICmpInst *ICI = dyn_cast<ICmpInst>(U);  in eliminateTrunc()  local
548 if (!ICI) return false; in eliminateTrunc()
549 assert(L->contains(ICI->getParent()) && "LCSSA form broken?"); in eliminateTrunc()
550 if (!(ICI->getOperand(0) == TI && L->isLoopInvariant(ICI->getOperand(1))) && in eliminateTrunc()
551 !(ICI->getOperand(1) == TI && L->isLoopInvariant(ICI->getOperand(0)))) in eliminateTrunc()
554 if (ICI->isSigned() && !DoesSExtCollapse) in eliminateTrunc()
556 if (ICI->isUnsigned() && !DoesZExtCollapse) in eliminateTrunc()
559 ICmpUsers.push_back(ICI); in eliminateTrunc()
562 auto CanUseZExt = [&](ICmpInst *ICI) { in eliminateTrunc() argument
564 if (ICI->isUnsigned()) in eliminateTrunc()
570 if (ICI->isEquality()) in eliminateTrunc()
576 const SCEV *SCEVOP1 = SE->getSCEV(ICI->getOperand(0)); in eliminateTrunc()
577 const SCEV *SCEVOP2 = SE->getSCEV(ICI->getOperand(1)); in eliminateTrunc()
581 for (auto *ICI : ICmpUsers) { in eliminateTrunc() local
582 bool IsSwapped = L->isLoopInvariant(ICI->getOperand(0)); in eliminateTrunc()
583 auto *Op1 = IsSwapped ? ICI->getOperand(0) : ICI->getOperand(1); in eliminateTrunc()
591 ICmpInst::Predicate Pred = ICI->getPredicate(); in eliminateTrunc()
593 if (CanUseZExt(ICI)) { in eliminateTrunc()
595 Ext = new ZExtInst(Op1, IVTy, "zext", ICI); in eliminateTrunc()
599 Ext = new SExtInst(Op1, IVTy, "sext", ICI); in eliminateTrunc()
605 ICmpInst *NewICI = new ICmpInst(ICI, Pred, IV, Ext); in eliminateTrunc()
606 ICI->replaceAllUsesWith(NewICI); in eliminateTrunc()
607 DeadInsts.emplace_back(ICI); in eliminateTrunc()