[LLVMdev] redefenition of variables in LLVM

Chris Lattner sabre at nondot.org
Sun Dec 12 00:18:27 PST 2004


On Sun, 12 Dec 2004, Chris Lattner wrote:
> No, this is Static Single Assignment form, which means there can only be one 
> assignment to a value.  If you want multiple assignment, use memory (such as 
> a stack location).  E.g.:
>
> %t4 = alloca int
> %_t4 = add int 23 ,  0
> store int %_t4, int* %t4
> %_t5 = add int %_t4 , 1
> %_t4 = add int %_t5 , 0
> store int %_t4, int* %t4

*** Sorry, of course this won't work either.  If you replace the last two 
lines with:

%_t4.2 = add int %_t5 , 0
store int %_t4.2, int* %t4

It should work.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.cs.uiuc.edu/




More information about the llvm-dev mailing list