[PATCH][IRA] Analysis of register usage of functions for usage by IRA.
Tom de Vries
Mon Jan 13 16:16:00 GMT 2014
On 10-01-14 12:39, Richard Earnshaw wrote:
>>> >>Consequently, you'll need to add a patch for AArch64 which has two
>>> >>registers clobbered by PLT-based calls.
>> >Thanks for pointing that out. That's r16 and r17, right? I can propose the hook
>> >for AArch64, once we all agree on how the hook should look.
> Yes; and thanks!
I'm posting this patch that implements the TARGET_FN_OTHER_HARD_REG_USAGE hook
for aarch64. It uses the conservative hook format for now.
I've build gcc and cc1 with the patch, and observed the impact on this code snippet:
bar (int x)
return x + 3;
foo (int y)
return y + bar (y);
AFAICT, that looks as expected:
$ gcc fuse-caller-save.c -mno-lra -fno-use-caller-save -O2 -S -o- > 1
$ gcc fuse-caller-save.c -mno-lra -fuse-caller-save -O2 -S -o- > 2
$ diff -u 1 2
--- 1 2014-01-13 16:51:24.000000000 +0100
+++ 2 2014-01-13 16:51:19.000000000 +0100
@@ -11,14 +11,12 @@
.type foo, %function
- stp x29, x30, [sp, -32]!
+ stp x29, x30, [sp, -16]!
+ mov w1, w0
add x29, sp, 0
- str x19, [sp,16]
- mov w19, w0
- add w0, w0, w19
- ldr x19, [sp,16]
- ldp x29, x30, [sp], 32
+ ldp x29, x30, [sp], 16
+ add w0, w0, w1
.size foo, .-foo
Btw, the results are the same for -mno-lra and -mlra. I'm just using the
-mno-lra version here because the -mlra version of -fuse-caller-save is still in
review ( http://gcc.gnu.org/ml/gcc-patches/2013-12/msg00586.html ).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1325 bytes
Desc: not available
More information about the Gcc-patches