[LLVMdev] Version 1.9 SSA form question

Andrew Lenharth andrewl at lenharth.org
Thu Mar 1 15:53:41 PST 2007


In the version of llvm you are using, names are only unique with
respect to their type.  There can be two %x if they have different
types.  Thus a variable isn't identified by name, but by <name, type>.
 This has changed in CVS.

Andrew

On 3/1/07, Schimmel, Mark <mark.schimmel at windriver.com> wrote:
> int %nlz10(uint %param.x) {
>         %.t3 = shr uint %param.x, ubyte 1               ; <uint>
> [#uses=1]
>         %.t4 = or uint %.t3, %param.x           ; <uint> [#uses=2]
>         %.t7 = shr uint %.t4, ubyte 2           ; <uint> [#uses=1]
>         %.t8 = or uint %.t7, %.t4               ; <uint> [#uses=2]
>         %.t11 = shr uint %.t8, ubyte 4          ; <uint> [#uses=1]
>         %.t12 = or uint %.t11, %.t8             ; <uint> [#uses=2]
>         %.t15 = shr uint %.t12, ubyte 8         ; <uint> [#uses=1]
>         %.t16 = or uint %.t15, %.t12            ; <uint> [#uses=2]
>         %.t19 = shr uint %.t16, ubyte 16                ; <uint>
> [#uses=1]
>         %.t20 = or uint %.t19, %.t16            ; <uint> [#uses=1]
>         %.t22 = mul uint %.t20, 116069625               ; <uint>
> [#uses=1]
>         %.t25 = shr uint %.t22, ubyte 26                ; <uint>
> [#uses=1]
>         %.t28 = getelementptr [64 x ubyte]* %table, int 0, uint %.t25
> ; <ubyte*> [#uses=1]
>         %.t28 = load ubyte* %.t28               ; <ubyte> [#uses=1]
>         %.t31 = cast ubyte %.t28 to int         ; <int> [#uses=1]
>         ret int %.t31
> }
>
> This is the disassembled output after running the optimizer.  How can
> %.t28 be written to twice?  That isn't my understanding of SSA.
>
> Here's another similar situation:
>
>         %x.2.i73 = cast uint %x.2.i73 to int            ; <int>
> [#uses=1]
>
> Why are we not assigning to a different ssa var?
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list