[PATCH] Enhance loop rotation with existence of profile data in MachineBlockPlacement pass.

Xinliang David Li davidxl at google.com
Tue Jul 7 16:40:10 PDT 2015


> In the suboptimal case, B6 is not in the middle of B5 and B0. I guess you
> mean B5 B0 B6 are separated from B7? So it is better to put B5 B0 B6 B7
> together? But how about Entry? If we treat Entry the same as B7, there is
> still no significant difference between the two layouts shown above.

typo. I meant B6 is sitting between B0 and the inner loop chain.

David

>
> If the inner loop is very cold (like < 20%), we need to take it out from the
> outer loop chain. I will tackle this issue in the coming patch.
>
>
> Cong
>
>>
>>
>> Given that the optimal outer loop layout does not actually reduce the
>> branch cost (but only icache reuse), I am fine leaving the
>> implementation as is assuming making it optimal requires a lot of
>> effort. I will be more comfortable if a loop nest example is added as
>> a test.
>>
>> David
>>
>>
>> >
>> >
>> > Cong
>> >
>> >
>> >>
>> >>
>> >> David
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Mon, Jul 6, 2015 at 10:22 AM, Cong Hou <congh at google.com> wrote:
>> >> > When the outer loop is rotated, the inner loop is already linked to
>> >> > other
>> >> > CFG nodes in the outer loop. So I think we won't have to adjust the
>> >> > current
>> >> > algorithm as we have already considered all costs the rotation may
>> >> > bring
>> >> > or
>> >> > reduce.
>> >> >
>> >> >
>> >> > thanks,
>> >> > Cong
>> >> >
>> >> > On Mon, Jul 6, 2015 at 9:57 AM, Xinliang David Li
>> >> > <xinliangli at gmail.com>
>> >> > wrote:
>> >> >>
>> >> >> Does the cost analysis work well for loop nest? After the inner loop
>> >> >> chain
>> >> >> is formed and rotated, it will be later be merged into the parent
>> >> >> loop
>> >> >> chain. The cost analysis for the parent loop may need to be adjusted
>> >> >> to
>> >> >> consider the inner loops that are already rotated.
>> >> >>
>> >> >> David
>> >> >>
>> >> >> On Tue, Jun 30, 2015 at 2:29 PM, Cong Hou <congh at google.com> wrote:
>> >> >>>
>> >> >>> Update the patch by adding two opt parameters that define the cost
>> >> >>> of
>> >> >>> misfetch and jump instruction, and use them when rotating loops.
>> >> >>>
>> >> >>>
>> >> >>> http://reviews.llvm.org/D10717
>> >> >>>
>> >> >>> Files:
>> >> >>>   lib/CodeGen/MachineBlockPlacement.cpp
>> >> >>>   test/CodeGen/X86/code_placement_loop_rotation.ll
>> >> >>>
>> >> >>> EMAIL PREFERENCES
>> >> >>>   http://reviews.llvm.org/settings/panel/emailpreferences/
>> >> >>>
>> >> >>> _______________________________________________
>> >> >>> llvm-commits mailing list
>> >> >>> llvm-commits at cs.uiuc.edu
>> >> >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>> >> >>>
>> >> >>
>> >> >
>> >
>> >
>
>



More information about the llvm-commits mailing list