From: Manman Ren Date: Mon, 31 Mar 2014 21:06:36 +0000 (+0000) Subject: Register allocator: set CSRFirstUseCost to 5 for ARM64. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=c7e0a8178a69fa5ea7d3b1f72290c4580cc69502;p=oota-llvm.git 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205248 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM64/ARM64RegisterInfo.h b/lib/Target/ARM64/ARM64RegisterInfo.h index 78265f74345..ac9382700c2 100644 --- a/lib/Target/ARM64/ARM64RegisterInfo.h +++ b/lib/Target/ARM64/ARM64RegisterInfo.h @@ -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;