diff --git a/llvm/include/llvm/Support/InstructionCost.h b/llvm/include/llvm/Support/InstructionCost.h --- a/llvm/include/llvm/Support/InstructionCost.h +++ b/llvm/include/llvm/Support/InstructionCost.h @@ -196,14 +196,6 @@ return *this >= RHS2; } - static InstructionCost min(InstructionCost LHS, InstructionCost RHS) { - return LHS < RHS ? LHS : RHS; - } - - static InstructionCost max(InstructionCost LHS, InstructionCost RHS) { - return LHS > RHS ? LHS : RHS; - } - void print(raw_ostream &OS) const; }; diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -6305,7 +6305,7 @@ Cost -= UserCost; } - MinCost = InstructionCost::min(MinCost, Cost); + MinCost = std::min(MinCost, Cost); if (Cost.isValid() && Cost < -SLPCostThreshold) { LLVM_DEBUG(dbgs() << "SLP: Vectorizing list at cost:" << Cost << ".\n"); diff --git a/llvm/unittests/Support/InstructionCostTest.cpp b/llvm/unittests/Support/InstructionCostTest.cpp --- a/llvm/unittests/Support/InstructionCostTest.cpp +++ b/llvm/unittests/Support/InstructionCostTest.cpp @@ -59,6 +59,6 @@ EXPECT_EQ(*(VThree.getValue()), 3); EXPECT_EQ(IThreeA.getValue(), None); - EXPECT_EQ(InstructionCost::min(VThree, VNegTwo), -2); - EXPECT_EQ(InstructionCost::max(VThree, VSix), 6); + EXPECT_EQ(std::min(VThree, VNegTwo), -2); + EXPECT_EQ(std::max(VThree, VSix), 6); }