Skip to content

Commit d46902e

Browse files
authored
[Hexagon] Simplify an array of physical register ids. NFC (#128066)
Make the array const. Use MCPhysReg, which is uint16_t, to reduce its size. Remove NoRegister terminator by using a range-based for loop to access.
1 parent 6757cf4 commit d46902e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,20 +1076,18 @@ void HexagonFrameLowering::insertCFIInstructionsAt(MachineBasicBlock &MBB,
10761076
.addCFIIndex(MF.addFrameInst(OffR30));
10771077
}
10781078

1079-
static Register RegsToMove[] = {
1079+
static const MCPhysReg RegsToMove[] = {
10801080
Hexagon::R1, Hexagon::R0, Hexagon::R3, Hexagon::R2,
10811081
Hexagon::R17, Hexagon::R16, Hexagon::R19, Hexagon::R18,
10821082
Hexagon::R21, Hexagon::R20, Hexagon::R23, Hexagon::R22,
10831083
Hexagon::R25, Hexagon::R24, Hexagon::R27, Hexagon::R26,
10841084
Hexagon::D0, Hexagon::D1, Hexagon::D8, Hexagon::D9,
1085-
Hexagon::D10, Hexagon::D11, Hexagon::D12, Hexagon::D13,
1086-
Hexagon::NoRegister
1085+
Hexagon::D10, Hexagon::D11, Hexagon::D12, Hexagon::D13
10871086
};
10881087

10891088
const std::vector<CalleeSavedInfo> &CSI = MFI.getCalleeSavedInfo();
10901089

1091-
for (unsigned i = 0; RegsToMove[i] != Hexagon::NoRegister; ++i) {
1092-
Register Reg = RegsToMove[i];
1090+
for (MCPhysReg Reg : RegsToMove) {
10931091
auto IfR = [Reg] (const CalleeSavedInfo &C) -> bool {
10941092
return C.getReg() == Reg;
10951093
};

0 commit comments

Comments
 (0)