![]() We were analyzing code quality after recent changes and have noticed that the tbz support somehow managed to increase the number of branches overall rather than decreased them. While investigating this we figured out that the problem is that when an existing & <contants> exists in gimple and the instruction is generated because of the range information gotten from the ANDed constant that we end up with the situation that you get a NOP AND in the RTL expansion. This is not a problem as CSE will take care of it normally. The issue is when this original AND was done in a location where PRE or FRE "lift" the AND to a different basic block. This triggers a problem when the resulting value is not single use. Instead of having an AND and tbz, we end up generating an AND + TST + BR if the mode is HI or QI. This CSE across BB was a problem before but this change made it worse. Our branch patterns rely on combine being able to fold AND or zero_extends into the instructions. To work around this (since a proper fix is outside of the scope of stage-4) we are limiting the new tbranch optab to only HI and QI mode values. This isn't a problem because these two modes are modes for which we don't have CBZ support, so they are the problematic cases to begin with. Additionally booleans are QI. The second thing we're doing is limiting the only legal bitpos to pos 0. i.e. only the bottom bit. This such that we prevent the double ANDs as much as possible. Now most other cases, i.e. where we had an explicit & in the source code are still handled correctly by the anonymous (*tb<optab><ALLI:mode><GPI:mode>1) pattern that was added along with tbranch support. This means we don't expand the superflous AND here, and while it doesn't fix the problem that in the cross BB case we loss tbz, it also doesn't make things worse. With these tweaks we've now reduced the number of insn uniformly was originally expected. gcc/ChangeLog: * config/aarch64/aarch64.md (tbranch_<code><mode>3): Restrict to SHORT and bottom bit only. gcc/testsuite/ChangeLog: * gcc.target/aarch64/tbz_2.c: New test. * gcc.target/aarch64/tbz_3.c: New test. |
||
---|---|---|
c++tools | ||
config | ||
contrib | ||
fixincludes | ||
gcc | ||
gnattools | ||
gotools | ||
include | ||
INSTALL | ||
intl | ||
libada | ||
libatomic | ||
libbacktrace | ||
libcc1 | ||
libcody | ||
libcpp | ||
libdecnumber | ||
libffi | ||
libgcc | ||
libgfortran | ||
libgm2 | ||
libgo | ||
libgomp | ||
libiberty | ||
libitm | ||
libobjc | ||
libphobos | ||
libquadmath | ||
libsanitizer | ||
libssp | ||
libstdc++-v3 | ||
libvtv | ||
lto-plugin | ||
maintainer-scripts | ||
zlib | ||
.dir-locals.el | ||
.gitattributes | ||
.gitignore | ||
ABOUT-NLS | ||
ar-lib | ||
ChangeLog | ||
ChangeLog.jit | ||
ChangeLog.tree-ssa | ||
compile | ||
config-ml.in | ||
config.guess | ||
config.rpath | ||
config.sub | ||
configure | ||
configure.ac | ||
COPYING | ||
COPYING.LIB | ||
COPYING.RUNTIME | ||
COPYING3 | ||
COPYING3.LIB | ||
depcomp | ||
install-sh | ||
libtool-ldflags | ||
libtool.m4 | ||
ltgcc.m4 | ||
ltmain.sh | ||
ltoptions.m4 | ||
ltsugar.m4 | ||
ltversion.m4 | ||
lt~obsolete.m4 | ||
MAINTAINERS | ||
Makefile.def | ||
Makefile.in | ||
Makefile.tpl | ||
missing | ||
mkdep | ||
mkinstalldirs | ||
move-if-change | ||
multilib.am | ||
README | ||
symlink-tree | ||
test-driver | ||
ylwrap |
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.