[LLVMdev] Prevent a intrinsic to be reordered?

Andrew Lenharth
Mon, 15 Sep 2008 13:12:03 -0000

On Sun, Sep 14, 2008 at 12:52 PM, Julio <julio.martin.hidalgo at
gmail.com> wrote:
> Hello, I have an intrinsic that matches to a asm instruction directly. This
> intrinsic starts a coprocessor that can do anything.
>
> If I put another instruction next to it (a multiplication for example), the
> "llc" reorders and puts the intrinsic after the multiplication.
>
> I have tried all:
>  - Setting the instruction like if it takes 256 cycles or 0 cycles.
>  - Setting the instruction with "hasSideEffects" (which is
ignored I think)
>  - Setting the instruction as a load, branch, call, etc....
>  - ....
>
> These later things are ignored, I don't know if when the intrinsic is
> lowered, then it doesn't matter (or perhaps the reorder is made
before).
>
> Any clues?

Does your instruction have a flag output?

Andrew