Skip to content

Commit 63efd8e

Browse files
committed
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 llvm-svn: 205248
1 parent f751d62 commit 63efd8e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Target/ARM64/ARM64RegisterInfo.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ struct ARM64RegisterInfo : public ARM64GenRegisterInfo {
4040
getCalleeSavedRegs(const MachineFunction *MF = 0) const override;
4141
const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
4242

43+
unsigned getCSRFirstUseCost() const {
44+
// The cost will be compared against BlockFrequency where entry has the
45+
// value of 1 << 14. A value of 5 will choose to spill or split really
46+
// cold path instead of using a callee-saved register.
47+
return 5;
48+
}
49+
4350
// Calls involved in thread-local variable lookup save more registers than
4451
// normal calls, so they need a different mask to represent this.
4552
const uint32_t *getTLSCallPreservedMask() const;

0 commit comments

Comments
 (0)