• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/Transforms/Utils/

Lines Matching refs:IVOperand

80     Value *foldIVUser(Instruction *UseInst, Instruction *IVOperand);
82 bool eliminateIdentitySCEV(Instruction *UseInst, Instruction *IVOperand);
88 bool eliminateIVUser(Instruction *UseInst, Instruction *IVOperand);
89 bool makeIVComparisonInvariant(ICmpInst *ICmp, Value *IVOperand);
90 void eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand);
91 void simplifyIVRemainder(BinaryOperator *Rem, Value *IVOperand,
97 bool strengthenOverflowingOperation(BinaryOperator *OBO, Value *IVOperand);
98 bool strengthenRightShift(BinaryOperator *BO, Value *IVOperand);
105 /// IVOperand is guaranteed SCEVable, but UseInst may not be.
107 /// Return the operand of IVOperand for this induction variable if IVOperand can
110 Value *SimplifyIndvar::foldIVUser(Instruction *UseInst, Instruction *IVOperand) {
122 if (IVOperand != UseInst->getOperand(OperIdx) ||
128 if (!isa<BinaryOperator>(IVOperand)
129 || !isa<ConstantInt>(IVOperand->getOperand(1)))
132 IVSrc = IVOperand->getOperand(0);
161 LLVM_DEBUG(dbgs() << "INDVARS: Eliminated IV operand: " << *IVOperand
172 if (IVOperand->use_empty())
173 DeadInsts.emplace_back(IVOperand);
178 Value *IVOperand) {
181 if (IVOperand != ICmp->getOperand(0)) {
183 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand");
197 auto *PN = dyn_cast<PHINode>(IVOperand);
247 void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) {
251 if (IVOperand != ICmp->getOperand(0)) {
253 assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand");
274 } else if (makeIVComparisonInvariant(ICmp, IVOperand)) {
358 void SimplifyIndvar::simplifyIVRemainder(BinaryOperator *Rem, Value *IVOperand,
365 bool UsedAsNumerator = IVOperand == NValue;
616 /// side-effect given the range of IV values. IVOperand is guaranteed SCEVable,
619 Instruction *IVOperand) {
621 eliminateIVComparison(ICmp, IVOperand);
627 simplifyIVRemainder(Bin, IVOperand, IsSRem);
647 if (eliminateIdentitySCEV(UseInst, IVOperand))
696 Instruction *IVOperand) {
698 (UseInst->getType() != IVOperand->getType()) ||
699 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand)))
719 // If UseInst is not a PHI node then we know that IVOperand dominates
721 if (!DT || !DT->dominates(IVOperand, UseInst))
724 if (!LI->replacementPreservesLCSSAForm(UseInst, IVOperand))
729 UseInst->replaceAllUsesWith(IVOperand);
739 Value *IVOperand) {
770 /// Annotate the Shr in (X << IVOperand) >> C as exact using the
774 Value *IVOperand) {
779 ConstantRange IVRange = SE->getUnsignedRange(SE->getSCEV(IVOperand));
783 m_AShr(m_Shl(m_Value(), m_Specific(IVOperand)), m_APInt(C))) ||
785 m_LShr(m_Shl(m_Value(), m_Specific(IVOperand)), m_APInt(C)))) {
898 Instruction *IVOperand = UseOper.second;
899 for (unsigned N = 0; IVOperand; ++N) {
902 Value *NewOper = foldIVUser(UseInst, IVOperand);
905 IVOperand = dyn_cast<Instruction>(NewOper);
907 if (!IVOperand)
910 if (eliminateIVUser(UseInst, IVOperand)) {
911 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers);
917 strengthenOverflowingOperation(BO, IVOperand)) ||
918 (isa<ShlOperator>(BO) && strengthenRightShift(BO, IVOperand))) {
921 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers);