[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
Dale Johannesen
dalej at apple.com
Wed Oct 28 10:21:05 PDT 2009
On Oct 28, 2009, at 10:02 AMPDT, Bob Wilson wrote:
>>> 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?
Branch folding is a size optimization. It would not surprise me if
turning it off completely at
-O3 was the right thing for performance. My only strong belief is
that any change should be based on measurements, not arguments.
More information about the llvm-commits
mailing list