Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions llvm/include/llvm/Support/InstructionCost.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "llvm/Support/MathExtras.h"
#include <limits>
#include <tuple>

namespace llvm {

Expand Down Expand Up @@ -191,9 +192,7 @@ class InstructionCost {
/// the states are valid and users can test for validity of the cost
/// explicitly.
bool operator<(const InstructionCost &RHS) const {
if (State != RHS.State)
return State < RHS.State;
return Value < RHS.Value;
return std::tie(State, Value) < std::tie(RHS.State, RHS.Value);
}

bool operator==(const InstructionCost &RHS) const {
Expand Down
6 changes: 1 addition & 5 deletions llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ namespace {
return !operator==(R);
}
bool operator<(const OffsetRange &R) const {
if (Min != R.Min)
return Min < R.Min;
if (Max != R.Max)
return Max < R.Max;
return Align < R.Align;
return std::tie(Min, Max, Align) < std::tie(R.Min, R.Max, R.Align);
}
static OffsetRange zero() { return {0, 0, 1}; }
};
Expand Down
Loading