This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
0006-GCSE-complex-constants.patch
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: Jeff Law <law at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 16 Jun 2010 19:58:53 +0400
- Subject: 0006-GCSE-complex-constants.patch
- References: <4C18F225.2040509@codesourcery.com>
Certain architectures (e.g., ARM) cannot easily operate with constants,
they need to emit sequences of several instructions to load constants
into registers. The common procedure to do this is to emit a (parallel
[(set) (clobber (reg1)) ... (clobber (regN))]) instruction which later
splits into several instructions using pseudos (regX) to store
intermediate values.
Currently PRE and hoist do not GCSE constants, and there is a good
reason for that, to avoid increasing register pressure; interestingly,
symbol_refs are allowed to be GCSE'ed, is this intentional or by accident?
In any case, it seems like a good idea to GCSE constants and symbol_refs
that need something beyond a simple (set) to get into a register, and
not GCSE them otherwise.
This patch adds a simple heuristic to gcse.c:want_to_gcse_p() that
adjusts preferences for CONST_INTs and SYMBOL_REFs.
OK to apply?
Thank you,
--
Maxim Kuvyrkov
CodeSourcery
maxim@codesourcery.com
(650) 331-3385 x724
Attachment:
0006-GCSE-complex-constants.ChangeLog
Description: Text document
Attachment:
0006-GCSE-complex-constants.patch
Description: Text document