[LLVMdev] instruction ids

Eli Friedman eli.friedman at gmail.com
Sat May 14 23:20:27 PDT 2011


On Sat, May 14, 2011 at 8:09 PM, George Baah <georgebaah at gmail.com> wrote:
> Hi All,
>   I was wondering if llvm assigns instructions distinct ids so that
> two instructions of the same type in the same function or different
> function will have different ids? Thanks.

Based on the textual IR, it's possible to uniquely specify an
instruction by @functionname:%valuename.  You can also use the
instnamer pass to force every value to have a name, which allows the
same sort of ID.  When the IR is just in memory, and some values don't
have names, there isn't any ID assigned.  (Of course, every
Instruction has a unique address in memory, so you can just use
pointer identity in most cases.)

-Eli




More information about the llvm-dev mailing list