[LLVMdev] SSA?

Eli Friedman eli.friedman at gmail.com
Wed Nov 25 17:48:23 PST 2009


On Wed, Nov 25, 2009 at 5:18 PM, dan mihai <dnmh68 at hotmail.com> wrote:
> However the following instruction has a 'bitcast' inserted as an operand,
> rather then the result of a previous bitcast:
> /*1*/
>     (void)store i32 (...)* bitcast (i32 ()* @pf to i32 (...)*), i32 (...)**
> @[2]pf0, align 8
>
> In this case, the bitcast is a constant, but it does DEFINE a new value
> and that value is the operand. I would have thought that the above code
> should have been "pure IR/SSA":
> /*2*/
>     %TMP = bitcast (i32 ()* @pf to i32 (...)*)
>     (void)store i32 (...)* %TMP, i32 (...)** @[2]pf0, align 8
> or something like that...

A constant expression is assumed to be unique and defined everywhere,
just like a constant integer or the address of a global.  Think of it
as the result of the bitcast being defined everywhere, but written
inside of the instruction for convenience.

-Eli




More information about the llvm-dev mailing list