[LLVMdev] How to insert two instructions with the same name?
isanbard at gmail.com
Sun Oct 8 01:37:06 PDT 2006
On Oct 8, 2006, at 1:15 AM, Zhou Sheng wrote:
> i want to insert a PHI into one basicblock like this:
> %s.1 = phi int [ 80, %entry ], [ %tmp21, %bb17 ]
> then, insert a cast inst. into another basicblock like this:
> %s.1 = cast int %s.1 to uint
> But, when i do this, the llvm automatically change the same name
> into a new one.
In SSA, any assignment creates a new variable. So it'd probably be
called something like "%s.2" or whatever. Technically, LLVM doesn't
care what the names of these variables are. They aren't used in the
internal representation. Only pointers to instructions matter (and
> Actually, i found that sometimes, llvm will create bytecode
> containing two instructions with same name. So, how can i implement
Again, the names are meaningless and are given only because the user
needs to be able to understand the .ll code. So it's entirely
possible to have multiple variables with the same name.
More information about the llvm-dev