[llvm] r261990 - [AArch64] Slight cleanup in FPLoadBalancing

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 01:10:53 PST 2016


Author: jamesm
Date: Fri Feb 26 03:10:53 2016
New Revision: 261990

URL: http://llvm.org/viewvc/llvm-project?rev=261990&view=rev
Log:
[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).

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp?rev=261990&r1=261989&r2=261990&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp Fri Feb 26 03:10:53 2016
@@ -530,8 +530,7 @@ int AArch64A57FPLoadBalancing::scavengeR
   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;
   }
 




More information about the llvm-commits mailing list