diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 8a3e0bc3eb971..bfd618ccdd379 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -1262,14 +1262,14 @@ static std::optional createReplacement(ICmpInst *ICmp, const Loop *L, BasicBlock *ExitingBB, const SCEV *MaxIter, bool Inverted, bool SkipLastIter, ScalarEvolution *SE, SCEVExpander &Rewriter) { - ICmpInst::Predicate Pred = ICmp->getPredicate(); + CmpPredicate Pred = ICmp->getCmpPredicate(); Value *LHS = ICmp->getOperand(0); Value *RHS = ICmp->getOperand(1); // 'LHS pred RHS' should now mean that we stay in loop. auto *BI = cast(ExitingBB->getTerminator()); if (Inverted) - Pred = CmpInst::getInversePredicate(Pred); + Pred = ICmpInst::getInverseCmpPredicate(Pred); const SCEV *LHSS = SE->getSCEVAtScope(LHS, L); const SCEV *RHSS = SE->getSCEVAtScope(RHS, L); diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp index f05d32d980e5a..e41a1adadfcc5 100644 --- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp @@ -205,12 +205,12 @@ bool SimplifyIndvar::makeIVComparisonInvariant(ICmpInst *ICmp, if (!Preheader) return false; unsigned IVOperIdx = 0; - ICmpInst::Predicate Pred = ICmp->getPredicate(); + CmpPredicate Pred = ICmp->getCmpPredicate(); if (IVOperand != ICmp->getOperand(0)) { // Swapped assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand"); IVOperIdx = 1; - Pred = ICmpInst::getSwappedPredicate(Pred); + Pred = ICmpInst::getSwappedCmpPredicate(Pred); } // Get the SCEVs for the ICmp operands (in the specific context of the @@ -249,13 +249,13 @@ bool SimplifyIndvar::makeIVComparisonInvariant(ICmpInst *ICmp, void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Instruction *IVOperand) { unsigned IVOperIdx = 0; - ICmpInst::Predicate Pred = ICmp->getPredicate(); + CmpPredicate Pred = ICmp->getCmpPredicate(); ICmpInst::Predicate OriginalPred = Pred; if (IVOperand != ICmp->getOperand(0)) { // Swapped assert(IVOperand == ICmp->getOperand(1) && "Can't find IVOperand"); IVOperIdx = 1; - Pred = ICmpInst::getSwappedPredicate(Pred); + Pred = ICmpInst::getSwappedCmpPredicate(Pred); } // Get the SCEVs for the ICmp operands (in the specific context of the