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]

0006-GCSE-complex-constants.patch


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


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