[llvm-dev] How to add a barrier pseudo instruction? (original) (raw)

Matthias Braun via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 19 13:43:46 PDT 2018


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



More information about the llvm-dev mailing list