[PATCH] D25132: Invoke add-discriminator at -g0 -fsample-profile

Diego Novillo via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 08:27:46 PDT 2016


dnovillo added a comment.

In https://reviews.llvm.org/D25132#559074, @danielcdh wrote:

> Another option would be: make SampleProfileFile option global, and checks if that option is empty here to decide if discriminator pass is needed.


Yeah, I think this might be a safer option.  Is there no other way to decide whether -g0 was passed?  Isn't -g0 recorded as a debug level or something like that?



> danielcdh wrote in AddDiscriminators.cpp:165
> With -g0, getDwarfVersion() will return 0. I think it's fine to have discriminators even when the debug info does not support it. It will simply not getting emitted?

Sure, but it will also trigger when the target does not support DWARF4. I think, this would cause a failure for DWARF <4, but Eric or David would be better at answering this.

https://reviews.llvm.org/D25132





More information about the llvm-commits mailing list