[llvm] r205248 - Register allocator: set CSRFirstUseCost to 5 for ARM64.

Manman Ren manman.ren at gmail.com
Mon Mar 31 14:06:36 PDT 2014


Author: mren
Date: Mon Mar 31 16:06:36 2014
New Revision: 205248

URL: http://llvm.org/viewvc/llvm-project?rev=205248&view=rev
Log:
Register allocator: set CSRFirstUseCost to 5 for ARM64.

A value of 5 means if we have a split or spill option that has a really
low cost (1 << 14 is the entry frequency), we will choose to spill
or split the really cold path before using a callee-saved register.

This gives us the performance benefit on SPECInt2k and is also conservative.

rdar://16162005

Modified:
    llvm/trunk/lib/Target/ARM64/ARM64RegisterInfo.h

Modified: llvm/trunk/lib/Target/ARM64/ARM64RegisterInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM64/ARM64RegisterInfo.h?rev=205248&r1=205247&r2=205248&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM64/ARM64RegisterInfo.h (original)
+++ llvm/trunk/lib/Target/ARM64/ARM64RegisterInfo.h Mon Mar 31 16:06:36 2014
@@ -40,6 +40,13 @@ public:
   getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
   const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
 
+  unsigned getCSRFirstUseCost() const {
+    // The cost will be compared against BlockFrequency where entry has the
+    // value of 1 << 14. A value of 5 will choose to spill or split really
+    // cold path instead of using a callee-saved register.
+    return 5;
+  }
+
   // Calls involved in thread-local variable lookup save more registers than
   // normal calls, so they need a different mask to represent this.
   const uint32_t *getTLSCallPreservedMask() const;





More information about the llvm-commits mailing list