Lines Matching refs:IVOperand

78     Value *foldIVUser(Instruction *UseInst, Instruction *IVOperand);
80 bool eliminateIdentitySCEV(Instruction *UseInst, Instruction *IVOperand);
87 bool eliminateIVUser(Instruction *UseInst, Instruction *IVOperand);
88 bool makeIVComparisonInvariant(ICmpInst *ICmp, Instruction *IVOperand);
89 void eliminateIVComparison(ICmpInst *ICmp, Instruction *IVOperand);
90 void simplifyIVRemainder(BinaryOperator *Rem, Instruction *IVOperand,
97 Instruction *IVOperand);
98 bool strengthenRightShift(BinaryOperator *BO, Instruction *IVOperand);
128 Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand) { in foldIVUser() argument
140 if (IVOperand != UseInst->getOperand(OperIdx) || in foldIVUser()
146 if (!isa<BinaryOperator>(IVOperand) in foldIVUser()
147 || !isa<ConstantInt>(IVOperand->getOperand(1))) in foldIVUser()
150 IVSrc = IVOperand->getOperand(0); in foldIVUser()
180 LLVM_DEBUG(dbgs() << "INDVARS: Eliminated IV operand: " << *IVOperand in foldIVUser()
191 if (IVOperand->use_empty()) in foldIVUser()
192 DeadInsts.emplace_back(IVOperand); in foldIVUser()
197 Instruction *IVOperand) { in makeIVComparisonInvariant() argument
200 if (IVOperand != ICmp->getOperand(0)) { in makeIVComparisonInvariant()
202 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand"); in makeIVComparisonInvariant()
213 auto *PN = dyn_cast<PHINode>(IVOperand); in makeIVComparisonInvariant()
267 Instruction *IVOperand) { in eliminateIVComparison() argument
271 if (IVOperand != ICmp->getOperand(0)) { in eliminateIVComparison()
273 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand"); in eliminateIVComparison()
294 } else if (makeIVComparisonInvariant(ICmp, IVOperand)) { in eliminateIVComparison()
379 Instruction *IVOperand, in simplifyIVRemainder() argument
386 bool UsedAsNumerator = IVOperand == NValue; in simplifyIVRemainder()
605 Instruction *IVOperand) { in eliminateIVUser() argument
607 eliminateIVComparison(ICmp, IVOperand); in eliminateIVUser()
613 simplifyIVRemainder(Bin, IVOperand, IsSRem); in eliminateIVUser()
633 if (eliminateIdentitySCEV(UseInst, IVOperand)) in eliminateIVUser()
686 Value *IVOperand = UseInst->getOperand(0); in replaceFloatIVWithIntegerIV() local
688 const SCEV *IV = SE->getSCEV(IVOperand); in replaceFloatIVWithIntegerIV()
699 if (!CI || IVOperand->getType() != CI->getType()) in replaceFloatIVWithIntegerIV()
706 CI->replaceAllUsesWith(IVOperand); in replaceFloatIVWithIntegerIV()
709 << " with: " << *IVOperand << '\n'); in replaceFloatIVWithIntegerIV()
721 Instruction *IVOperand) { in eliminateIdentitySCEV() argument
723 (UseInst->getType() != IVOperand->getType()) || in eliminateIdentitySCEV()
724 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand))) in eliminateIdentitySCEV()
746 if (!DT || !DT->dominates(IVOperand, UseInst)) in eliminateIdentitySCEV()
749 if (!LI->replacementPreservesLCSSAForm(UseInst, IVOperand)) in eliminateIdentitySCEV()
754 UseInst->replaceAllUsesWith(IVOperand); in eliminateIdentitySCEV()
764 Instruction *IVOperand) { in strengthenOverflowingOperation() argument
788 Instruction *IVOperand) { in strengthenRightShift() argument
793 ConstantRange IVRange = SE->getUnsignedRange(SE->getSCEV(IVOperand)); in strengthenRightShift()
797 m_AShr(m_Shl(m_Value(), m_Specific(IVOperand)), m_APInt(C))) || in strengthenRightShift()
799 m_LShr(m_Shl(m_Value(), m_Specific(IVOperand)), m_APInt(C)))) { in strengthenRightShift()
912 Instruction *IVOperand = UseOper.second; in simplifyUsers() local
913 for (unsigned N = 0; IVOperand; ++N) { in simplifyUsers()
917 Value *NewOper = foldIVUser(UseInst, IVOperand); in simplifyUsers()
920 IVOperand = dyn_cast<Instruction>(NewOper); in simplifyUsers()
922 if (!IVOperand) in simplifyUsers()
925 if (eliminateIVUser(UseInst, IVOperand)) { in simplifyUsers()
926 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers); in simplifyUsers()
932 strengthenOverflowingOperation(BO, IVOperand)) || in simplifyUsers()
933 (isa<ShlOperator>(BO) && strengthenRightShift(BO, IVOperand))) { in simplifyUsers()
936 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers); in simplifyUsers()
943 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers); in simplifyUsers()