Richard Sandiford 037cc0b4a6 ira: Handle "soft" conflicts between cap and non-cap allocnos
This patch looks for allocno conflicts of the following form:

- One allocno (X) is a cap allocno for some non-cap allocno X2.
- X2 belongs to some loop L2.
- The other allocno (Y) is a non-cap allocno.
- Y is an ancestor of some allocno Y2 in L2.
- Y2 is not referenced in L2 (that is, ALLOCNO_NREFS (Y2) == 0).
- Y can use a different allocation from Y2.

In this case, Y's register is live across L2 but is not used within it,
whereas X's register is used only within L2.  The conflict is therefore
only "soft", in that it can easily be avoided by spilling Y2 inside L2
without affecting any insn references.

In principle we could do this for ALLOCNO_NREFS (Y2) != 0 too, with the
callers then taking Y2's ALLOCNO_MEMORY_COST into account.  There would
then be no "cliff edge" between a Y2 that has no references and a Y2 that
has (say) a single cold reference.

However, doing that isn't necessary for the PR and seems to give
variable results in practice.  (fotonik3d_r improves slightly but
namd_r regresses slightly.)  It therefore seemed better to start
with the higher-value zero-reference case and see how things go.

On top of the previous patches in the series, this fixes the exchange2
regression seen in GCC 11.

gcc/
	PR rtl-optimization/98782
	* ira-int.h (ira_soft_conflict): Declare.
	* ira-color.c (max_soft_conflict_loop_depth): New constant.
	(ira_soft_conflict): New function.
	(spill_soft_conflicts): Likewise.
	(assign_hard_reg): Use them to handle the case described by
	the comment above ira_soft_conflict.
	(improve_allocation): Likewise.
	* ira.c (check_allocation): Allow allocnos with "soft" conflicts
	to share the same register.

gcc/testsuite/
	* gcc.target/aarch64/reg-alloc-4.c: New test.
2022-01-10 14:47:09 +00:00
2022-01-03 10:42:10 +01:00
2021-12-22 00:16:30 +00:00
2022-01-04 00:16:40 +00:00
2022-01-07 00:16:24 +00:00
2021-10-23 00:16:26 +00:00
2021-09-22 00:16:28 +00:00
2022-01-03 10:42:10 +01:00
2021-11-30 00:16:44 +00:00
2022-01-03 10:42:10 +01:00
2022-01-03 10:42:10 +01:00
2022-01-03 10:42:10 +01:00
2022-01-03 10:42:10 +01:00
2022-01-03 10:42:10 +01:00
2022-01-03 10:42:10 +01:00
2021-11-16 00:16:31 +00:00
2022-01-05 00:16:52 +00:00
2022-01-05 00:16:52 +00:00
2022-01-03 10:42:10 +01:00
2022-01-04 00:16:40 +00:00
2022-01-03 10:42:10 +01:00
2021-10-20 00:16:43 +00:00
2022-01-04 00:16:40 +00:00
2022-01-04 00:16:40 +00:00
2021-12-07 00:16:23 +00:00
2022-01-03 10:42:10 +01:00
2022-01-03 10:42:10 +01:00
2022-01-03 10:42:10 +01:00
2021-05-15 00:16:27 +00:00
2021-12-17 00:16:20 +00:00
2021-06-24 16:51:40 +05:30
2022-01-08 00:16:27 +00:00
2021-12-21 09:10:57 +01:00
2022-01-05 04:03:58 -08:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 2.1 GiB
Languages
C++ 31.9%
C 31.3%
Ada 12%
D 6.5%
Go 6.4%
Other 11.5%