[NFC] Remove min/max functions from InstructionCost

Removed the InstructionCost::min/max functions because it's
fine to use std::min/max instead.

Differential Revision: https://reviews.llvm.org/D94301
This commit is contained in:
David Sherwood 2021-01-07 15:02:50 +00:00
parent dcefcd51e0
commit b7ccaca537
3 changed files with 3 additions and 11 deletions

View File

@ -196,14 +196,6 @@ public:
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;
};

View File

@ -6305,7 +6305,7 @@ bool SLPVectorizerPass::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R,
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");

View File

@ -59,6 +59,6 @@ TEST_F(CostTest, Operators) {
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);
}