[PATCH] D27596: Add a PreRASplit pass to enable more shrinkwrap
Wei Mi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 10 14:54:24 PST 2017
wmi added a comment.
Hi Nemanja,
I tried your testcase with my experimental patch (got from here: http://lists.llvm.org/pipermail/llvm-dev/2017-February/109977.html) and saw that the testcase was not shrinkwrap optimized (cmd I used: clang -O2 -target powerpc64le-grtev4-linux-gnu -S 1.c).
Existing reg splitting for live range across function calls took effect. After splitting, the sub vreg across call got CSR register assigned, and the other sub vreg got a non-CSR register. These all work as we expect. However, during tryHintRecoloring, the two sub vregs are coalesced again.
I add a simple logic in tryHIntRecoloring: If we are going to switch from a non-CSR reg to a CSR reg, only when the recoloring cost difference is larger than CSRCost, we will do such recoloring. In other words, to justify the planning recoloring, the benefit must be at least larger than the potential negative impact on shrinkwrapping.
With the change, the testcase is shrinkwrap optimized. I attach the changed experimental patch. F3073432: csrsplit.v2.txt <https://reviews.llvm.org/F3073432>
Thanks,
Wei.
Repository:
rL LLVM
https://reviews.llvm.org/D27596
More information about the llvm-commits
mailing list