On 2/26/19 5:18 PM, Segher Boessenkool wrote: > On Tue, Feb 26, 2019 at 04:58:17PM -0700, Jeff Law wrote: >> On 2/26/19 4:19 PM, Segher Boessenkool wrote: >>> On Tue, Feb 26, 2019 at 10:07:54AM -0700, Jeff Law wrote: >> For gcc-10 we should: >> >> 1. Avoid really stupid stuff in init-regs. >> >> 2. Avoid really stupid stuff in the splitters. >> >> 3. Make REE SUBREG-aware >> >> 4. Seriously consider a RTL DCE pass after post-reload splitting >> >> But none of those would actually fix this BZ :-) > > Since we are talking about pie-in-the-sky stuff... I'd like to run some > kind of mini-combine after every split pass (just on the new insns). As > it is the (later) splitters often leave non-optimal code unless a lot of > work is put into those splitters. We should not have as many late > splitters as we do, but for those we do need, it would be helpful if the > compiler could do simple combinations without having to hand-code them. #1 is downright trivial. #2 is pretty easy as well. #3 could be painful, but is probably worth it. #4 is trivial, but would probably have a measurable compile-time cost.
> >>> [ I don't see any problems with -O2 btw, only with -O1, so should we care >>> at all anyway? ] >> You can get this stuff at -O2 on other platforms. It's far more common >> than I ever imagined. > > Yeah, that's because the testcase uses -fno-split-wide-types. The subreg > passes do great work :-) My point is we see this stuff all the time on common platforms with simple -O2 optimization. It deleted something like 2k dead insns on an x86_64 bootstrap before I added goof'd up trap_p test. What I don't have a sense of is how often removing that trivially dead code ultimately helped cprop on x86_64. But the amount of trivially dead code on a standard -O2 bootstrap was a huge surprise. Jeff