[LLVMdev] questions about the mc-relax-all flag

Jim Grosbach grosbach at apple.com
Fri Dec 7 09:28:40 PST 2012


On Dec 7, 2012, at 7:22 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

>>> It is not used on optimized builds because it produces larger binaries.
>>> 
>> 
>> Yep. So if we intend to keep it around I propose to rename it to
>> -mc-optimize-relaxation, or -mc-fast-relaxation or something of the
>> sort (I think that the flag is obscure enough to deserve a long,
>> verbose and descriptive name).
> 
> So, normally "optimize" in a compiler means "produce better code", not
> "produce code faster", so -mc-optimize-relaxation would be more
> confusing IMHO.

Yep. This is exactly why I disagree with calling this an optimization. :)

In any case, I still want to get rid of the command line option entirely. If there are cases where we want to enable the behavior for compile time performance (-O0), then that should happen automatically. We don't need or want a ton of micro-tuning knobs on the compiler command line.

-Jim

> 
> A relaxation in an assembler is the act of replacing an instruction
> with a more generic one. An add that takes a 8 bit immediate with one
> that takes a 32 immediate for example. For that reason I think the
> current name is fine: the option makes the assembler relax every
> instruction it can to the most generic available. This produces larger
> code, but the assembler doesn't spend time figuring out if the more
> specific version works or not.
> 
>> Eli
> 
> Cheers,
> Rafael





More information about the llvm-dev mailing list