[llvm-dev] Textual IR value names

David Greene via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 9 14:12:06 PST 2019

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


More information about the llvm-dev mailing list