summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2016-02-26 09:10:53 +0000
committerJames Molloy <james.molloy@arm.com>2016-02-26 09:10:53 +0000
commit4eba0154fb19081462e67666ffaa815036ffe7c5 (patch)
treeab27deedbe471eb7b227020d606681e585f73ae0 /llvm/lib
parentcf5352db84c968fa02f6d9d724c85689b02d10b4 (diff)
downloadbcm5719-llvm-4eba0154fb19081462e67666ffaa815036ffe7c5.tar.gz
bcm5719-llvm-4eba0154fb19081462e67666ffaa815036ffe7c5.zip
[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
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp b/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
index 3d1ab4e3fc2..61dc157726c 100644
--- a/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
+++ b/llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
@@ -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;
}
OpenPOWER on IntegriCloud