[LLVMdev] Fwd: LLVM IR Branchs

Rafael Baldiati Parizi parizi.computacao at gmail.com
Mon Sep 5 17:37:49 PDT 2011


Yes, that's how I'm doing now ... create a new block where the execution
flow will continue after the shift, following the basics of basic blocks.
But, I want to find a way to reduce the number of block of my code.

2011/9/5 Nick Lewycky <nicholas at mxc.ca>

> Rafael Baldiati Parizi 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 not. The definition of a "basic block" is a sequence of
> instructions with a single entry and a single exit. You can not insert
> multiple exits within a basic block.
>
> I realize that this restriction feels arbitrary, but there's a vast amount
> of research and practical experience in compiler design built around the
> notion of basic blocks making up a control flow graph.
>
> Nick
>
>  2011/9/5 Eli Friedman <eli.friedman at gmail.com
>> <mailto:eli.friedman at gmail.com**>>
>>
>>
>>    On Mon, Sep 5, 2011 at 4:47 PM, Rafael Baldiati Parizi
>>    <parizi.computacao at gmail.com <mailto:parizi.computacao@**gmail.com<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/*
>>
>>
>>
>>
>>
>> ______________________________**_________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>>
>
>


-- 
*Rafael Parizi*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110905/0cd0ddef/attachment.html>


More information about the llvm-dev mailing list