[llvm-dev] Textual IR value names

Davide Italiano via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 9 14:16:15 PST 2019

On Wed, Jan 9, 2019 at 2:12 PM David Greene via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I like my LLVM IR text to have nice value names, e.g.
> %add = add ...
> %mul = mul ...
> And this all works well if the build has asserts enabled.  If the build
> does not have asserts enabled, it's not so nice:
> %1 = add ...
> %2 = mul ...
> I understand the use for obfuscating names, but the choice to make this
> dependent on whether or not asserts are enabled seems odd to me.  At the
> very least it's surprising.  It took some time for me to figure out why
> some of our builds behaved differently than others.
> Is this an intentional design choice?  If so, what's the rationale?  If
> not, would it make sense to add a CMake option to specify whether
> textual IR preserves names or not rather than overloading

You can use `opt -instnamer`.


"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare

More information about the llvm-dev mailing list