[AArch64] Slight cleanup in FPLoadBalancing

Instead of the convoluted if-statment we can just use getColor. This also fixes
a bug where we relied upon the parity of tablegen-generated register indexes
(instead of using the machine encoding).

llvm-svn: 261990
This commit is contained in:
James Molloy 2016-02-26 09:10:53 +00:00
parent cf5352db84
commit 4eba0154fb
1 changed files with 1 additions and 2 deletions

View File

@ -530,8 +530,7 @@ int AArch64A57FPLoadBalancing::scavengeRegister(Chain *G, Color C,
for (auto Reg : Ord) {
if (!AvailableRegs[Reg])
continue;
if ((C == Color::Even && (Reg % 2) == 0) ||
(C == Color::Odd && (Reg % 2) == 1))
if (C == getColor(Reg))
return Reg;
}