[LLVMdev] How to prevent an instruction to be executed more than once?

Alistair Lynn arplynn at gmail.com
Thu Jun 24 05:09:42 PDT 2010


Hello-

Doing control-flow (jumps and/or labels) in inline asm is a really bad idea. What are you trying to achieve?

Alistair

On 24 Jun 2010, at 12:54, Xinfinity wrote:

> 
> Hi LLVM-devs,
> 
> I am looking for a way to prevent an instruction to be executed more than
> once, or duplicated .. I know that by default everything can be duplicated,
> but is there a work-around?
> 
> The structure of the code is 
> BB1    BB2
>   |          |
>   |          |
>   |          |
>   |----------|
>        |
>        v
>       BB3
> 
> where the first instruction in BB3 is inserting an inline assembly which
> contains a newly defined label:
> 
>            call void asm "BB4_label:\0A", ""()
> 
> I want to find a way to have this instruction executed only once. The
> problem is that in the optimisation steps, LLVM duplicates BB3 and
> concatenates it with BB1 and with BB2, therefore the label is defined twice,
> which gives an error.
> 
> Is it possible to do this, without having to modify the back-end of LLVM ?
> 
> Thanks,
> Alexandra
> 
> -- 
> View this message in context: http://old.nabble.com/How-to-prevent-an-instruction-to-be-executed-more-than-once--tp28981639p28981639.html
> Sent from the LLVM - Dev mailing list archive at Nabble.com.
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev





More information about the llvm-dev mailing list