[llvm-dev] How to add a barrier pseudo instruction?

Son Tuan VU via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 1 14:43:38 PDT 2018


Hi Tim and Matthias,

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?

@Tim Northover <t.p.northover at gmail.com>
> I don't think active scheduling (i.e. trying to optimize order for
> speed) goes on in IR, but incidental movements will definitely happen.
So is there any way to prevent these incidental movements in the IR?

Again, thanks for your help
Son Tuan Vu


On Wed, Sep 19, 2018 at 10:43 PM Matthias Braun <mbraun at apple.com> wrote:

>
>
> > On Sep 19, 2018, at 3:39 AM, Tim Northover via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
> >
> > Hi Son,
> >
> > On Tue, 18 Sep 2018 at 21:01, Son Tuan VU <sontuan.vu119 at gmail.com>
> wrote:
> >> So IIUC, optimization passes in opt do not reorder IR instructions,
> only passes in llc that move MIR instructions around. Is it correct?
> >
> > I don't think active scheduling (i.e. trying to optimize order for
> > speed) goes on in IR, but incidental movements will definitely happen.
> >
> >> 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?
> >
> > Not in detail, I'm afraid. I'd never heard of isSchedulingBoundary
> > before. It looks like it might improve matters if you really want to
> > enforce no movement, but it wasn't designed for the purpose so I
> > couldn't guarantee it.
>
> 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...
>
> >
> > Cheers.
> >
> > Tim.
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181001/a60b36eb/attachment.html>


More information about the llvm-dev mailing list