[llvm-dev] Textual IR value names
llvm-dev at lists.llvm.org
Thu Jan 10 07:08:36 PST 2019
Also, the textual IR is really a developer/debugging tool, not something an end-user would be expected to look at, so the textual names would be largely pointless in a release build.
If you are writing lit tests that look at textual IR, and they are failing with release builds, you can add the "REQUIRES: asserts" directive to the lit test so that the test won't be run for a release build.
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Craig Topper via llvm-dev
Sent: Wednesday, January 09, 2019 5:41 PM
To: David Greene
Cc: llvm-dev at lists.llvm.org
Subject: Re: [llvm-dev] Textual IR value names
The names are dropped to save memory when a release build of the compiler is being used. This is what you probably want on a release compiler you intend to ship since it should be faster. The NDEBUG check is an easy way to tell the difference between release and debug builds. People probably don't want to have to remember to set an additional cmake option to make a release compiler faster.
The -fdiscard-value-names/-fno-discard-value-names was added about a year ago https://reviews.llvm.org/D42887 not sure if there is more discussion about the asserts behavior discussed there.
On Wed, Jan 9, 2019 at 2:25 PM David Greene <dag at cray.com<mailto:dag at cray.com>> wrote:
Craig Topper via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> writes:
> And the clang behavior can be controlled with -
That's a little better for users, but again, why should the default
behavior change based on whether or not asserts are enabled?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev