]> git.ipfire.org Git - thirdparty/gcc.git/commit
ira: Consider save/restore costs of callee-save registers [PR110071]
authorSurya Kumari Jangala <jskumari@linux.ibm.com>
Thu, 14 Sep 2023 07:12:50 +0000 (02:12 -0500)
committerSurya Kumari Jangala <jskumari@linux.ibm.com>
Wed, 20 Sep 2023 01:52:34 +0000 (20:52 -0500)
commit677249a23243b5b51832611767366d6eb199bdc7
tree4a2bfc759be6e5df71cc2df32fe73589b4e358aa
parentc44926fe2dc570103339dbb120914dabf655be07
ira: Consider save/restore costs of callee-save registers [PR110071]

In improve_allocation() routine, IRA checks for each allocno if spilling
any conflicting allocnos can improve the allocation of this allocno.
This routine computes the cost improvement for usage of each profitable
hard register for a given allocno. The existing code in
improve_allocation() does not consider the save/restore costs of callee
save registers while computing the cost improvement.

This can result in a callee save register being assigned to a pseudo
that is live in the entire function and across a call, overriding a
non-callee save register assigned to the pseudo by graph coloring. So
the entry basic block requires a prolog, thereby causing shrink wrap to
fail.

2023-09-14  Surya Kumari Jangala  <jskumari@linux.ibm.com>

gcc/
PR rtl-optimization/110071
* ira-color.cc (improve_allocation): Consider cost of callee
save registers.

gcc/testsuite/
PR rtl-optimization/110071
* gcc.target/powerpc/pr110071.c: New test.
gcc/ira-color.cc
gcc/testsuite/gcc.target/powerpc/pr110071.c [new file with mode: 0644]