> I think you are right about it being an optimization (compile time > optimization to be precise). In fact, it is used by default at -O0, > run "clang -c test.c -v" and you will see -mrelax-all being passed, > but not if you add -O1. > > 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). Eli
>> 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. 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.> EliCheers, Rafael
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