[llvm-dev] phi node as an operand

John Criswell via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 15 06:52:40 PST 2016


On 1/15/16 9:44 AM, Mohammad Norouzi via llvm-dev wrote:
> Hi all,
>
> Is it possible to have phi nodes as an operand to an instruction?

Yes, you can use a phi node as an operand to an instruction. However, 
the phi-node must dominate any instruction that uses it as an operand.

Regards,

John Criswell

>
> For example, instead of
>
> %input = phi <ty> [ <val0>, <label0>] [<val1>, <label1>] %2 = .....
> %add = add i32 %2, %input
>
> we have sth like this:
> %add = add i32 %2, %phi <ty> [ <val0>, <label0>] [<val1>, <label1>]
> Best,
> Mo
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160115/4e222dd4/attachment.html>


More information about the llvm-dev mailing list