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

Son Tuan VU via llvm-dev llvm-dev at lists.llvm.org
Sun Sep 16 14:01:20 PDT 2018


Hello all,

I want to add a custom intrinsic to the LLVM IR which would be lowered into
a pseudo instruction since it doesn't correspond to any real instruction
defined by the architecture. The speciality of this intrinsic/pseudo
instruction that it should behave like a scheduling barrier: every
instruction before the intrinsic has to be emitted before the intrinsic,
the same goes for all instructions after the intrinsic, and this should
hold after any optimization in opt and llc.

Can anyone tell me if this is something available in the current LLVM
infrastructure and if so, what should be the correct way to create this
intrinsic/pseudo instruction? Which bit should be set to 1? isBarrier or
hasSideEffects or both? I cannot find the documentation for these 2 bits
other than the comments in Target.td, so I'd like to have some explanation
here.

Thank you so much for your help,

Son Tuan Vu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180916/2ef110cb/attachment.html>


More information about the llvm-dev mailing list