<div dir="ltr"><div>Hi Tim and Matthias,</div><div><br></div><div>Thank you a lot for your replies. So currently LLVM doesn't have any mechanism to strictly prevent any reordering in any level (IR, DAG or MIR), is it something desirable?</div><div><br><a class="gmail_plusreply" id="plusReplyChip-0" href="mailto:t.p.northover@gmail.com" tabindex="-1">@Tim Northover</a></div><div>> I don't think active scheduling (i.e. trying to optimize order for<br>
> speed) goes on in IR, but incidental movements will definitely happen.</div><div>So is there any way to prevent these incidental movements in the IR?<br></div><div><br></div><div>Again, thanks for your help<br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Son Tuan Vu</div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 19, 2018 at 10:43 PM Matthias Braun <<a href="mailto:mbraun@apple.com">mbraun@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On Sep 19, 2018, at 3:39 AM, Tim Northover via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> <br>
> Hi Son,<br>
> <br>
> On Tue, 18 Sep 2018 at 21:01, Son Tuan VU <<a href="mailto:sontuan.vu119@gmail.com" target="_blank">sontuan.vu119@gmail.com</a>> wrote:<br>
>> So IIUC, optimization passes in opt do not reorder IR instructions, only passes in llc that move MIR instructions around. Is it correct?<br>
> <br>
> I don't think active scheduling (i.e. trying to optimize order for<br>
> speed) goes on in IR, but incidental movements will definitely happen.<br>
> <br>
>> On the back-end (llc) side, hasSideEffects might prevent some reordering. But I just learn about TargetInstrInfo::isSchedulingBoundary. Can you tell me what are the differences between the two please?<br>
> <br>
> Not in detail, I'm afraid. I'd never heard of isSchedulingBoundary<br>
> before. It looks like it might improve matters if you really want to<br>
> enforce no movement, but it wasn't designed for the purpose so I<br>
> couldn't guarantee it.<br>
<br>
I believe isSchedulingBoundary is a tool to designate scheduling areas for the machine scheduler. I don't think it will prevent movement in all cases. I would not expect things like MachineLICM or SelectionDAG combines to look at it when they deal with instructions without side effects or memory operands...<br>
<br>
> <br>
> Cheers.<br>
> <br>
> Tim.<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div></div>