[PATCH] D34608: [AArch64] Increase CSR cost when defering use of CSR is preferred
Jun Bum Lim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 25 20:08:19 PDT 2017
junbuml created this revision.
Herald added subscribers: kristof.beyls, javed.absar, mcrosier, MatzeB, rengolin, aemerson.
The RegAllocGreedy currently favours allocating a CSR over splitting a region.
With this change we try to defer allocating CSR by increasing the CSR cost when
none of user blocks in the live range contains a call. Similar change was
initially suggested by Nemanja in https://reviews.llvm.org/D27366 for PowerPC and Wei posted https://reviews.llvm.org/D32201 to
increase the CSR cost.
Comparing with https://reviews.llvm.org/D27366, this change is more conservative in splitting over allocating
CSR becuase we increase the CSR cost only when none of blocks in the live range
have call. Instead of a fixed arbitrary CSR cost, we increase the CSR cost considering
the number of tradable splits/spills against a spill of a CSR in the entry block.
I'm posting this since it seems that Nemanja is no longer pursuing https://reviews.llvm.org/D27366.
Hopefully this change open up more productive discussion and make progress
in the context-sensitive CSR cost model.
With this patch, I observed +10% performance gain in spec2006/astar in AArch64.
https://reviews.llvm.org/D34608
Files:
include/llvm/Target/TargetLowering.h
lib/CodeGen/RegAllocGreedy.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
test/CodeGen/AArch64/csr-split.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34608.103886.patch
Type: text/x-patch
Size: 9827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170626/62a5b43b/attachment.bin>
More information about the llvm-commits
mailing list