[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 11:16:21 PDT 2009


On Oct 28, 2009, at 11:10 AM, Evan Cheng wrote:

>
> On Oct 28, 2009, at 10:38 AM, Chris Lattner wrote:
>
>>
>> On Oct 28, 2009, at 10:21 AM, Dale Johannesen wrote:
>>
>>>> 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.
>>
>> Doesn't it also do some code layout to encourage better fall-throughs
>> etc?
>>
> That has been removed. The heuristics have shown to do as much harm  
> on x86 as good. On ARM (especially Thumb), it's badness. Block  
> layout optimizations are now done in CodePlacementOpt.cpp.

Some code layout is still done in BranchFolding.  For blocks with no  
successors, we still do the same transformation that we were doing  
before in BranchFolding.  Dan just changed it to not apply to all  
blocks ending with unconditional branches.

This doesn't really matter, since Dale clarified that he was  
specifically referring to tail merging, and not to all of BranchFolding.



More information about the llvm-commits mailing list