[LLVMdev] Question About the LLVM IR unnamed values!
t.p.northover at gmail.com
Tue Jan 14 00:41:54 PST 2014
> is that means the unnamed instructions like "%0 %1" all created by the
> "load" instructions? is there any other type instructions can create unnamed
The names are chosen in clang rather than LLVM. When it's creating an
instruction there's an optional "Name" field, which seems to mostly be
filled in. So to answer that question, you'd have to look at all
places in Clang that create instructions.
I strongly suspect there are other cases that don't give a name, but
the only ones I can think of at the moment are expansions of certain
compiler builtins (e.g. SIMD intrinsics, probably va_arg and similar).
Also, in release builds, the name is completely ignored and all
instructions are anonymous.
So you certainly shouldn't be relying on the fact that everything
except loads are named. But I can't see any particular reason we'd
turn down patches that added useful names in more cases.
More information about the llvm-dev