12 Commits

Author SHA1 Message Date
Hongyu Wang
70bccee5fa [SPR] Enable small loop unrolling for O2
Modern processors has multiple way instruction decoders
For x86, icelake/zen3 has 5 uops, so for small loop with <= 4
instructions (usually has 3 uops with a cmp/jmp pair that can be
macro-fused), the decoder would have 2 uops bubble for each iteration
and the pipeline could not be fully utilized.

Therefore, this patch enables loop unrolling for small size loop at O2
to fullfill the decoder as much as possible. It turns on rtl loop
unrolling when targetm.loop_unroll_adjust exists and O2 plus speed only.
In x86 backend the default behavior is to unroll small loops with less
than 4 insns by 1 time.

This improves 548.exchange2 by 9% on icelake and 7.4% on zen3 with
0.9% codesize increment. For other benchmarks the variants are minor
and overall codesize increased by 0.2%.

The kernel image size increased by 0.06%, and no impact on eembc.

gcc/ChangeLog:

	* common/config/i386/i386-common.cc (ix86_optimization_table):
	Enable small loop unroll at O2 by default.
	* config/i386/i386.cc (ix86_loop_unroll_adjust): Adjust unroll
	factor if -munroll-only-small-loops enabled and -funroll-loops/
	-funroll-all-loops are disabled.
	* config/i386/i386.h (struct processor_costs): Add 2 field
	small_unroll_ninsns and small_unroll_factor.
	* config/i386/i386.opt: Add -munroll-only-small-loops.
	* doc/invoke.texi: Document -munroll-only-small-loops.
	* loop-init.cc (pass_rtl_unroll_loops::gate): Enable rtl
	loop unrolling for -O2-speed and above if target hook
	loop_unroll_adjust exists.
	(pass_rtl_unroll_loops::execute): Set UAP_UNROLL flag
	when target hook loop_unroll_adjust exists.
	* config/i386/x86-tune-costs.h: Update all processor costs
	with small_unroll_ninsns = 4 and small_unroll_factor = 2.

gcc/testsuite/ChangeLog:

	# Please ety/loop-1.c: Add additional option
	-mno-unroll-only-small-loops.
	* gcc.target/i386/pr86270.c: Add -mno-unroll-only-small-loops.
	* gcc.target/i386/pr93002.c: Likewise.

url:https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=071e428c24ee8c1ed062597a093708bba29509c9
2022-11-30 09:16:59 +08:00
Chenxi Mao
0fce60c9dc Support program-suffix configuration
Add "--program-suffix" in configuration stage via binsuffix defination.

For example, if binsuffix is set to "-12" the binary will be compiled
as below format:
gcc-12
cpp-12
...

The binsuffix is set to %{nil} to make sure the files name are same
with previous release.

Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
2022-11-18 19:39:07 +08:00
Chenxi Mao
a63c1aaaf9 Customized package name
Current default package name is scl_prefix-*, some product need to
customized the package name under specific product policy.

After this change, if we set the configuration as below:
%global scl_prefix %{nil}
%global gcc_ver %{gcc_major}

gcc12/cpp12 will be the new package name.

Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
2022-11-18 14:21:01 +08:00
Chenxi Mao
55cfa61071 Fix invalid link file issue
Below link file cannot find the target after installation:
find -xtype l | xargs ls -l --color
lrwxrwxrwx. 1 root root 19 Nov 14 19:09 ./libexec/getconf/default -> POSIX_V6_LP64_OFF64
lrwxrwxrwx. 1 root root 36 Nov 14 19:09 ./lib/gcc/x86_64-suse-linux/12/libatomic.so -> ../../../../lib64/libatomic.so.1.2.0
lrwxrwxrwx. 1 root root 35 Nov 14 19:09 ./lib/gcc/x86_64-suse-linux/12/libubsan.so -> ../../../../lib64/libubsan.so.1.0.0

To fix this issue, modify spec file as below:
1. Remove libatomic.so libubsan.so to its package
2. Change the ./libexec/getconf/default target path

Signed-off-by: Chenxi Mao <chenxi.mao@suse.com>
2022-11-16 12:54:53 +08:00
Cui,Lili
4dc52e5c19 [SPR] Add attribute hot judgement for INLINE_HINT_known_hot hint.
We set up INLINE_HINT_known_hot hint only when we have profile feedback,
now add function attribute judgement for it, when both caller and callee
have __attribute__((hot)), we will also set up INLINE_HINT_known_hot hint
for it.

With this patch applied,
ADL Multi-copy:    538.imagic_r  16.7%
ICX Multi-copy:    538.imagic_r  15.2%
CLX Multi-copy:    538.imagic_r  12.7%
Znver3 Multi-copy: 538.imagic_r  10.6%
Arm Multi-copy:    538.imagic_r  13.4%

gcc/ChangeLog

	* ipa-inline-analysis.cc (do_estimate_edge_time): Add function attribute
	judgement for INLINE_HINT_known_hot hint.

gcc/testsuite/ChangeLog:

	* gcc.dg/ipa/inlinehint-6.c: New test.

url:https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1b9a5cc9ec08e9f239dd2096edcc447b7a72f64a
2022-11-16 09:35:15 +08:00
Cui,Lili
db41342444 [SPR] Remove AVX512_VP2INTERSECT from PTA_SAPPHIRERAPIDS
gcc/ChangeLog:

	* config/i386/driver-i386.cc (host_detect_local_cpu):
	Move sapphirerapids out of AVX512_VP2INTERSECT.
	* config/i386/i386.h: Remove AVX512_VP2INTERSECT from PTA_SAPPHIRERAPIDS
	* doc/invoke.texi: Remove AVX512_VP2INTERSECT from SAPPHIRERAPIDS

url: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=11c72f20d4d7ba1862a257cef05dc3a5e84a276d
2022-11-16 09:35:10 +08:00
Haochen Jiang
7954b2133e [SPR] i386: Add syscall to enable AMX for latest kernels
gcc/testsuite/ChangeLog:

	* gcc.target/i386/amx-check.h (request_perm_xtile_data):
	New function to check if AMX is usable and enable AMX.
	(main): Run test if AMX is usable.

url:https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5e377d21f1f345d8b157b9bc306e02bb9bd45e01
2022-11-16 09:34:27 +08:00
liyancheng
d9127a6b3f [RPM] Change isl dependency from Source to BuildRequire 2022-11-10 12:00:55 +08:00
liyancheng
25e20dc298 [RPM] Upgrade GCC to 12.2.1 2022-11-02 10:28:23 +08:00
eastb233
cc00d8055c [RPM] delete bundled(*) Provides in case of conflict with default gcc 2022-08-25 19:58:11 +08:00
eastb233
822355ee81 [RPM] delete the Provides of lib.* files in rpm package 2022-08-24 19:46:35 +08:00
eastb233
9f63bc52eb [Init] Initialize with gcc toolset 12.1.1
Initialize repo with multi-version gcc toolset.
2022-08-10 18:49:39 +08:00