Hi Richard, > + "add\\t%w0, %w2, %w, <su>xt<SHORT:size>" > > ^^^ %w1
Got spot. I guess that pattern hasn't fired yet then! I'll fix it. > > This patch significantly reduces the number of redundant > > uxtw instructions seen in a variety of programs. > > > > (There are further patterns that can be done, but I have them > > in a separate patch that's still in development.) > > What do you get if you enable flag_ree, as we do for x86_64? > In theory this should avoid even more extensions... > > > C.f. common/config/i386/i386-common.c: > > static const struct default_options ix86_option_optimization_table[] = > { > /* Enable redundant extension instructions removal at -O2 and > higher. */ > { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 }, > I should have said that I am indeed running with REE enabled. It has some impact (about 70 further UXTW removed from the set of binaries I've been building) and seems to mostly be good across basic blocks within the same function. As far as I can tell, there is no downside to REE, so I think it should be enabled by default for O2 or higher on AArch64 too. I'll prepare a new patch ...