[LLVMdev] Branch-like intrinsic

Edward Lee eslee3 at uiuc.edu
Mon Apr 14 14:29:20 PDT 2008


On Mon, Apr 14, 2008 at 5:11 PM, Chris Lattner <sabre at nondot.org> wrote:
>  Why not something like:
>    %x = llvm.myintrinsic()
>    br i1 %x, label %T, label %F
Right. That's exactly what I meant in the last paragraph of the
original message.

The reason for not wanting this is that %x actually always turns out
to be 1 (on architectures that support it), so %T is always taken. But
this unnecessarily adds overheads with the branch check. However, I do
want the semantics of the code to be a conditional branch, so that
optimization passes still know about the data flow going into %F.

But it wouldn't be the end of the world if I went with this approach. :)

Ed



More information about the llvm-dev mailing list