This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Remove loop notes (5/8) -- sh.c


Zdenek Dvorak wrote:

Hello,

there are two uses of loop notes in sh.c.  The first one is not
interesting -- it is in sh_adjust_unroll_max, that is dead and commented
out (another patch for its complete removal was proposed).  The
interesting one is in heuristics in sh_optimize_target_register_callee_saved.

The heuristics does not seem to be very useful (in fact I was not able
to get it run at all without first commenting out the previous
conditions); the patch removes it.

The heuristic triggers for at least one of the EEMBC codes.

For a minimalist synthetic testcase, try this:

extern int g ();

void
f ()
{
 while (g ());
}

Examples with labels are probably more likely to appear in real code, but seem
are a bit harder to construct from scratch, in a way that passes predictably through
the optimizers.


The patch was built and regtested in sh-sim.



sh-sim regtesting is meaningless for this patch.


In case someone is interested in replacing the heuristics later, I also
attach a patch for that; lacking the access to real hardware, I was
not able to test it properly, though,

There is a gdb with built-in simulator for sh64 in contrib.

which is why I propose the more
conservative patch for now.


This is not right, you are removing a useful optimization.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]