On 06/07/12 16:31, Ian Bolton wrote:
Hi,
This patch reduces codesize for cases such as this one:
int arr[100];
int foo () { return arr[10]; }
Before the patch, the code looked like this:
adrp x0, arr
add x0, x0, :lo12:arr
ldr w0, [x0,40]
Now, it looks like this:
adrp x0, arr+40
ldr w0, [x0,#:lo12:arr+40]
Some workloads have seen up to 1K reduction in code size.
OK to commit?
Cheers,
Ian
2012-07-06 Ian Bolton<ian.bol...@arm.com>
* gcc/config/aarch64/aarch64.c (aarch64_print_operand): Use
aarch64_classify_symbolic_expression for classifying operands.
* gcc/config/aarch64/aarch64.c
(aarch64_classify_symbolic_expression): New function.
* gcc/config/aarch64/aarch64.c (aarch64_symbolic_constant_p):
New function.
* gcc/config/aarch64/predicates.md (aarch64_valid_symref):
Symbol with constant offset is a valid symbol reference.
OK