mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-20 06:30:28 +08:00
If an insn requires two operands to be tied, and the input operand dies in the insn, IRA acts as though there were a copy from the input to the output with the same execution frequency as the insn. Allocating the same register to the input and the output then saves the cost of a move. If there is no such tie, but an input operand nevertheless dies in the insn, IRA creates a similar move, but with an eighth of the frequency. This helps to ensure that chains of instructions reuse registers in a natural way, rather than using arbitrarily different registers for no reason. This heuristic seems to work well in the vast majority of cases. However, for SVE, the handling of untied operands ends up creating copies between dying predicate registers and vector outputs, even though vector and predicate registers are distinct classes and can never be tied. This is a particular problem because the dying predicate tends to be the loop control predicate, which is used by most instructions in a vector loop and so (rightly) has a very high allocation priority. Any copies involving the loop predicate therefore tend to get processed before copies involving only vector registers. The end result is that we tend to allocate the output of the last vector instruction in a loop ahead of its natural place in the allocation order and don't benefit from chains created between vector registers. This patch tries to avoid the problem by not adding register shuffle copies if there appears to be no chance that the two operands could be allocated to the same register. 2019-09-21 Richard Sandiford <richard.sandiford@arm.com> gcc/ * ira-conflicts.c (can_use_same_reg_p): New function. (process_reg_shuffles): Take an insn parameter. Ignore cases in which input operand op_num could seemingly never be allocated to the same register as the destination. (add_insn_allocno_copies): Update call to process_reg_shuffles. gcc/testsuite/ * gcc.target/aarch64/sve/cond_convert_1.c: Remove XFAILs. * gcc.target/aarch64/sve/cond_convert_4.c: Likewise. * gcc.target/aarch64/sve/cond_unary_2.c: Likewise. From-SVN: r276018
…
…
…
…
…
…
…
…
…
…
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
Languages
C++
31.9%
C
31.3%
Ada
12%
D
6.5%
Go
6.4%
Other
11.5%