diff options
author | Xi Ruoyao <xry111@xry111.site> | 2023-06-14 08:24:05 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2023-06-15 15:40:43 +0800 |
commit | 19e4d4c34c98d19d64eb2a5ed3d252685b9470be (patch) | |
tree | 30530dfe63ec913593e2df85deac12d68219588e /gcc/tree-stdarg.cc | |
parent | df071fbd467f0cb3711119ef41d74792fc5e6c8c (diff) | |
download | gcc-19e4d4c34c98d19d64eb2a5ed3d252685b9470be.zip gcc-19e4d4c34c98d19d64eb2a5ed3d252685b9470be.tar.gz gcc-19e4d4c34c98d19d64eb2a5ed3d252685b9470be.tar.bz2 |
LoongArch: Set default alignment for functions and labels with -mtune
The LA464 micro-architecture is sensitive to alignment of code. The
Loongson team has benchmarked various combinations of function, the
results [1] show that 16-byte label alignment together with 32-byte
function alignment gives best results in terms of SPEC score.
Add a mtune-based table-driven mechanism to set the default of
-falign-{functions,labels}. As LA464 is the first (and the only for
now) uarch supported by GCC, the same setting is also used for
the "generic" -mtune=loongarch64. In the future we may set different
settings for LA{2,3,6}64 once we add the support for them.
Bootstrapped and regtested on loongarch64-linux-gnu. Ok for trunk?
gcc/ChangeLog:
* config/loongarch/loongarch-tune.h (loongarch_align): New
struct.
* config/loongarch/loongarch-def.h (loongarch_cpu_align): New
array.
* config/loongarch/loongarch-def.c (loongarch_cpu_align): Define
the array.
* config/loongarch/loongarch.cc
(loongarch_option_override_internal): Set the value of
-falign-functions= if -falign-functions is enabled but no value
is given. Likewise for -falign-labels=.
Diffstat (limited to 'gcc/tree-stdarg.cc')
0 files changed, 0 insertions, 0 deletions