This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Where can I put the optimization of got for arm back end at?
- From: Andrew Haley <aph at redhat dot com>
- To: Carrot Wei <carrot at google dot com>
- Cc: gcc at gcc dot gnu dot org, Richard Earnshaw <rearnsha at arm dot com>, Paul Brook <paul at codesourcery dot com>, nickc at redhat dot com
- Date: Thu, 01 Apr 2010 19:10:41 +0100
- Subject: Re: Where can I put the optimization of got for arm back end at?
- References: <7587b291003280745o651a9c61ia1abae6707832526@mail.gmail.com>
On 28/03/10 15:45, Carrot Wei wrote:
> Hi
>
> The detailed description of the optimization is at
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43129. This is an ARM
> specific optimization.
>
> This optimization uses one less register (the register hold the GOT
> base), to get this beneficial the ideal place for it should be before
> register allocation.
>
> Usually expand pass generates instructions to load global variable's
> address from GOT entry for each access of the global variable. Later
> cse/gcse passes can remove many of them. In order to precisely model
> the cost, this optimization should be put after some cse/gcse passes.
>
> So what is the best place for this optimization? Is there any existed
> pass can be enhanced with this optimization? Or should I add a new
> pass?
The obvious place is machine-dependent reorg, which is a very late pass.
Andrew.