[LLVMdev] Fwd: LLVM IR Branchs

Eli Friedman eli.friedman at gmail.com
Mon Sep 5 17:25:21 PDT 2011


On Mon, Sep 5, 2011 at 5:13 PM, Rafael Baldiati Parizi
<parizi.computacao at gmail.com> wrote:
> I have two values and I want see if them are equals. Then, I would a
> instruction like
> if Value1 != Value2, error
> without create a new block, continuing the execution in the same block,
> forcing the LLI to execute this.

You can't do that; a br instruction must be at the end of a block.

Splitting a block is trivial, though: the C++ API provides SplitBlock,
and if you're just manipulating the text, you can insert a br to a
label immediately followed by that label anywhere in any function
without changing the semantics of the program.

-Eli

> 2011/9/5 Eli Friedman <eli.friedman at gmail.com>
>>
>> On Mon, Sep 5, 2011 at 4:47 PM, Rafael Baldiati Parizi
>> <parizi.computacao at gmail.com> wrote:
>> > Hello,
>> > I would know how can I make a branch in llvm ir without a label of
>> > destination?
>> > For example:
>> > br i1 %1, label %bb,  NO LABEL HERE
>>
>> What are you trying to do?
>>
>> -Eli
>
>
>
> --
> Rafael Parizi
>
>
>
>




More information about the llvm-dev mailing list