[llvm-commits] [llvm] r85346 - in /llvm/trunk: include/llvm/CodeGen/Passes.h lib/CodeGen/BranchFolding.cpp lib/CodeGen/BranchFolding.h lib/CodeGen/IfConversion.cpp lib/CodeGen/LLVMTargetMachine.cpp lib/Target/ARM/ARMTargetMachine.cpp
Bob Wilson
bob.wilson at apple.com
Wed Oct 28 10:02:06 PDT 2009
On Oct 27, 2009, at 6:15 PM, Evan Cheng wrote:
>
> On Oct 27, 2009, at 4:49 PM, Bob Wilson wrote:
>
>> Author: bwilson
>> Date: Tue Oct 27 18:49:38 2009
>> New Revision: 85346
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=85346&view=rev
>> Log:
>> Record CodeGen optimization level in the BranchFolding pass so that
>> we can
>> use it to control tail merging when there is a tradeoff between
>> performance
>> and code size. When there is only 1 instruction in the common
>> tail, we have
>> been merging. That can be good for code size but is a definite
>> loss for
>> performance. Now we will avoid tail merging in that case when the
>> optimization level is "Aggressive", i.e., "-O3". Radar 7338114.
> Just then controlling this with optimization level, we should only
> do it when the function is marked OptSize. Would that work?
I'm not sure I understand what you're asking. Are you suggesting that
instead of disabling tail merging of 1 instruction for CodeGenOpt
level "Aggressive" (-O3) that we change so that case is disabled by
default and only enabled for functions with the OptimizeForSize
attribute (which is set by the front-end when using -Os)?
If so, yes, I think that would work. In fact, I think it would be a
good idea. At -O2, that would mean that we would be optimizing for
performance at a small cost in code size. That's a more aggressive
change than mine, but I think it would be a good idea.
Shall I go ahead with that?
More information about the llvm-commits
mailing list