[PATCH] D22778: Add Loop Sink pass to reverse the LICM based of basic block frequency.

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 31 07:31:03 PDT 2016


Sorry I didn't update the original thread before I implement this patch. My
understanding was Hal proposed IR level sinking at CGP, and I proposed
enhancing MachineSinking and Hal thinks that's also an workable plan.

But when I started implementing this in MachineSinking, I found that the
alias info support for loop at machine level is too weak. That's why
MachineLICM only handles function invariant load motion instead of loop
invariant load motion. I guess that's also the reasoning of the original
comment in MachineSink.cpp (Machine sinking should not replace IR sinking).

For now, the design is:

1. IR LICM handles most accurate hoisting at early stage
2. IR Sinking handles most accurate sinking before CGP
3. Machine LICM handles simple hoisting at machine level
4. MachineSinking handles simple sinking at machine level

I think this design makes sense because:

1. We don't need to introduce sophisticated alias analysis to machine level
loops
2. It's in perfect symmetry

But I'm open to discussions on other design alternatives.

Thanks,
Dehao

On Sat, Jul 30, 2016 at 11:55 PM, Chandler Carruth <chandlerc at google.com>
wrote:

> Thanks for that context.
>
> However, the conclusion there seemed to be to improve the MachineSinking
> pass rather than produce an IR level sinking pass, and I don't see anywhere
> that this direction change is explained.
>
> On Sat, Jul 30, 2016 at 10:37 PM Xinliang David Li via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> It seems phab did not have all the conversations recorded. Complete
>> discussion can be found in llvm-commits archive
>>
>> On Sat, Jul 30, 2016 at 10:31 PM, Xinliang David Li <davidxl at google.com>
>> wrote:
>> > See discussions in https://reviews.llvm.org/D19950
>> >
>> > David
>> >
>> > On Sat, Jul 30, 2016 at 10:18 PM, Chandler Carruth <chandlerc at gmail.com>
>> wrote:
>> >> chandlerc added a subscriber: chandlerc.
>> >> chandlerc added a comment.
>> >>
>> >> Have you talked to anyone about the design for this?
>> >>
>> >> I know Daniel Jasper, Quentin, and several others have looked at
>> similar things before. Previous attempts have focused on using MachineLICM
>> to do sinking as well as hoisting. While I don't have a strong opinion
>> about one design over the other, we should be consistent about the plan
>> here, and possibly consolidate some of the logic.
>> >>
>> >>
>> >> https://reviews.llvm.org/D22778
>> >>
>> >>
>> >>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160731/d375ed61/attachment.html>


More information about the llvm-commits mailing list