This is the mail archive of the gcc-bugs@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]

[Bug middle-end/15239] suboptimal mult-by-const expansion cost limit


------- 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


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