On Tue, May 1, 2012 at 7:46 AM, Richard Sandiford <rdsandif...@googlemail.com> wrote: > Ian Lance Taylor <i...@google.com> writes: >> Richard Sandiford <rdsandif...@googlemail.com> writes: >>> Does anyone else have any thoughts before I make that change? >> >> I think that one of you should try to write a test case where it makes a >> difference, and add the test case to the testsuite. > > I originally took that to mean a case where function vs. bb speed choices > made a difference. That isn't really possible as things stand because > I don't know of any in-tree port that assigns different rtx costs to > SETs based on the speed setting. > > But now I wonder whether you meant a test case where using rtx costs > makes a difference. I'm not really in a position to test ARM these days, > but it sounds like any testcase for the VUNZP patch would cover this too, > since it was this patch that prevented the VUNZP one from going in. > I'll also try to come up with a MIPS testcase when I look at that > (this weekend hopefully, but maybe not on recent form). > > Anyway, I modified the patch to use a per-function speed setting. > After the off-list discussion between you and Kenny, I went ahead > and applied it after retesting on x86_64-linux-gnu. > > To repeat: as things stand, very few targets define proper rtx costs > for SET. This patch is therefore expected to prevent lower-subreg > from running in cases where it's actually benefical. If you see that > happening, please check whether the rtx_costs are defined properly. > > Of course, if the costs are defined properly and lower-subreg still > makes the wrong choice, we need to look at why. > > Richard > > > gcc/ > 2012-03-31 Kenneth Zadeck <zad...@naturalbridge.com> > Richard Sandiford <r.sandif...@uk.ibm.com> > > * Makefile.in (lower-subreg.o, target-globals.o): Depend on > lower-subreg.h. > * lower-subreg.h: New file. > * target-globals.h (this_target_lower_subreg): Declare. > (target_globals): Add lower_subreg; > (restore_target_globals): Restore this_target_lower_subreg. > * target-globals.c: Include it. > (default_target_globals): Add default_target_lower_subreg. > (save_target_globals): Initialize target_lower_subreg. > * rtl.h (init_lower_subreg): Added declaration. > * toplev.c (backend_init_target): Call initializer for lower-subreg > pass. > * lower-subreg.c (LOG_COSTS, FORCE_LOWERING): New macros. > (default_target_lower_subreg): New variable. > (this_target_lower_subreg): Likewise. > (twice_word_mode, choices): New macros. > (shift_cost, compute_splitting_shift, compute_costs) > (init_lower_subreg): New functions. > (resolve_simple_move): Add speed_p argument. Check choices. > (find_pseudo_copy): Don't check the mode size here. > (resolve_simple_move): Assert the mode size. > (find_decomposable_shift_zext): Add speed_p argument and return > a bool. Check choices. > (resolve_shift_zext): Add comment. > (dump_shift_choices, dump_choices): New functions. > (decompose_multiword_subregs): Dump list of profitable > transformations. Add code to skip non profitable transformations. > Update calls to simple_move and find_decomposable_shift_zext. >
This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53176 -- H.J.