This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/15239] suboptimal mult-by-const expansion cost limit
- From: "l_belev at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 May 2004 13:06:26 -0000
- Subject: [Bug middle-end/15239] suboptimal mult-by-const expansion cost limit
- References: <20040430234603.15239.l_belev@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From l_belev at yahoo dot com 2004-05-01 13:06 -------
(In reply to comment #4)
> As I mentioned on the gcc list, this is apparently used to avoid
> unresaonble code size expansion. When converting multiplies to
> add-sequences, we limit the number of adds emitted to 12, so that the
> code size increase will be bounded.
In order to avoid unreasonable code size expansion, it probably would be
most apropriate to limit the total number of bytes the expansion is allowed
to span. Of course that's too platform dependent and may be problematic.
Another variant is to limit the munber of instructions, which although
not exactly what we need, still is more close to it than limiting the
number of cycles. IMO the number of cycles vary much more from one
instruction to another than the number of code bytes, no matter what the
architecture is. Generally the longer instructions are those with immediate
operands and in these expansions we probably don't use much of them (or the
immediates are 8-bit). Even better, AFAIK most RISC architectures have fixed
instruction sizes, so this way for them we would get exactly what we need.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15239