Skip to content
Merged
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
9 changes: 4 additions & 5 deletions llvm/lib/Target/AMDGPU/GCNRegPressure.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/RegisterPressure.h"
#include <algorithm>
#include <array>

namespace llvm {

Expand All @@ -45,7 +46,7 @@ struct GCNRegPressure {
return !Value[SGPR] && !Value[VGPR] && !Value[AGPR] && !Value[AVGPR];
}

void clear() { std::fill(&Value[0], &Value[ValueArraySize], 0); }
void clear() { Value.fill(0); }

unsigned getNumRegs(RegKind Kind) const {
assert(Kind < TOTAL_KINDS);
Expand Down Expand Up @@ -127,9 +128,7 @@ struct GCNRegPressure {
bool less(const MachineFunction &MF, const GCNRegPressure &O,
unsigned MaxOccupancy = std::numeric_limits<unsigned>::max()) const;

bool operator==(const GCNRegPressure &O) const {
return std::equal(&Value[0], &Value[ValueArraySize], O.Value);
}
bool operator==(const GCNRegPressure &O) const { return Value == O.Value; }

bool operator!=(const GCNRegPressure &O) const {
return !(*this == O);
Expand Down Expand Up @@ -160,7 +159,7 @@ struct GCNRegPressure {

/// Pressure for all register kinds (first all regular registers kinds, then
/// all tuple register kinds).
unsigned Value[ValueArraySize];
std::array<unsigned, ValueArraySize> Value;

static unsigned getRegKind(const TargetRegisterClass *RC,
const SIRegisterInfo *STI);
Expand Down