[LLVMdev] BranchInst comparison

Tim Northover t.p.northover at gmail.com
Thu Aug 15 06:59:57 PDT 2013


Hi Rasha,

> How could BranchInst be used to insert new branch between two basic blocks
> to get result like this example:
>
>  br label %if.else
>   br label %if.then
>   br i1 %cmp1, label %if.then, label %if.else

I think that's still unclear. A basic block containing those three
instructions would be invalid (only one terminating branch instruction
is allowed).

Why don't you write two functions, as simple as possible (but that llc
will compile), showing an example of the kind of IR you have, and the
kind you want?

Tim.



More information about the llvm-dev mailing list