[llvm] r291609 - CodeGen: Allow small copyable blocks to "break" the CFG.

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 10 22:02:04 PST 2017


Yes, this test case is exactly what the layout optimization is targeting.
With taildup enabled, the dynamic instruction count should remain the same,
and the number of taken branches (dynamic) should strictly reduce.

David

On Tue, Jan 10, 2017 at 7:13 PM, Kyle Butt <iteratee at google.com> wrote:

>
>
> On Tue, Jan 10, 2017 at 6:29 PM, Matt Arsenault <arsenm2 at gmail.com> wrote:
>
>>
>> > On Jan 10, 2017, at 15:04, Kyle Butt via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>> >
>> > Author: iteratee
>> > Date: Tue Jan 10 17:04:30 2017
>> > New Revision: 291609
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=291609&view=rev
>> > Log:
>> > CodeGen: Allow small copyable blocks to "break" the CFG.
>> >
>> > When choosing the best successor for a block, ordinarily we would have
>> preferred
>> > a block that preserves the CFG unless there is a strong probability the
>> other
>> > direction. For small blocks that can be duplicated we now skip that
>> requirement
>> > as well.
>> >
>> > Differential revision: https://reviews.llvm.org/D27742
>>
>> Hi,
>>
>> This has caused a code quality regression for me. Attached is a reduced
>> testcase. This patch caused a net gain of 2 branches and a compare
>> instruction. Any idea on how to fix it?
>>
>>
> I looked at the code in question. There are more compare instructions, but
> no codepath should execute more of them. Which codepath are you concerned
> about?
>
> For the compare, and 1 of the branches, it occurs due to tail duplication,
> and so for those, this is not a regression, it is WAI.
>
> Are you worried about the code size, or did this actually cause a
> performance regression?
> If it did cause a regression, can you tell me which path is the hot path?
>
>> -Matt
>>
>>
> Thanks,
> Kyle.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170110/b19dcbb4/attachment.html>


More information about the llvm-commits mailing list