[llvm-commits] [llvm] r86871 - in /llvm/trunk: lib/CodeGen/BranchFolding.cpp lib/CodeGen/MachineBasicBlock.cpp test/CodeGen/Thumb2/thumb2-cbnz.ll test/CodeGen/Thumb2/thumb2-ifcvt3.ll test/CodeGen/X86/loop-blocks.ll test/CodeGen/X86/tail-opts.ll

Chris Lattner clattner at apple.com
Thu Nov 12 13:54:01 PST 2009


On Nov 12, 2009, at 10:39 AM, Dan Gohman wrote:

>
> On Nov 11, 2009, at 11:42 PM, Duncan Sands wrote:
>
>> Hi Dan,
>>
>>> Add support for tail duplication to BranchFolding, and extend
>>> tail merging support to handle more cases.
>>> - Recognize several cases where tail merging is beneficial even when
>>>  the tail size is smaller than the generic threshold.
>>> - Make use of MachineInstrDesc::isBarrier to help detect
>>>  non-fallthrough blocks.
>>> - Check for and avoid disrupting fall-through edges in more cases.
>>
>> can this result in a label being sucked off the end of a block, and
>> moved into another?  Exception handling labels come in pairs, and it
>> would be wrong to move one of them without the other (even all the
>> instructions in between).
>
> My understanding is that each EH_LABEL has a unique ID, and this
> automatically prevents two of them from being merged.
>
> I just made a change to mark all label instructions as non-duplicable,
> to prevent tail-duplication and other code-duplicating optimizations
> from getting into trouble.

Does this cause debug labels to change optimization/codegen behavior?

-Chris



More information about the llvm-commits mailing list