[PATCH] Add a new target hook to compute the frame layout

Bernd Edlinger bernd.edlinger@hotmail.de
Thu Jun 16 14:47:00 GMT 2016


Hi!


By the design of the target hook INITIAL_ELIMINATION_OFFSET
it is necessary to call this function several times with
different register combinations.
Most targets use a cached data structure that describes the
exact frame layout of the current function.

It is safe to skip the computation when reload_completed = true,
and most targets do that already.

However while reload is doing its work, it is not clear when to
do the computation and when not.  This results in unnecessary
work.  Computing the frame layout can be a simple function or an
arbitrarily complex one, that walks all instructions of the current
function for instance, which is more or less the common case.


This patch adds a new optional target hook that can be used
by the target to factor the INITIAL_ELIMINATION_OFFSET-hook
into a O(n) computation part, and a O(1) result function.

The patch implements a compute_frame_layout target hook just
for ARM in the moment, to show the principle.
Other targets may also implement that hook, if it seems appropriate.


Boot-strapped and reg-tested on arm-linux-gnueabihf.
OK for trunk?


Thanks
Bernd.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: changelog-frame-layout.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160616/1e56bec2/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-frame-layout.diff
Type: text/x-patch
Size: 7404 bytes
Desc: patch-frame-layout.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160616/1e56bec2/attachment.bin>


More information about the Gcc-patches mailing list