This is an archive of the discontinued LLVM Phabricator instance.

Make new PM honor -fdebug-info-for-profiling (clang side)
ClosedPublic

Authored by danielcdh on Jul 21 2017, 3:58 PM.

Event Timeline

danielcdh created this revision.Jul 21 2017, 3:58 PM
chandlerc added inline comments.Jul 25 2017, 6:07 PM
lib/CodeGen/BackendUtil.cpp
843

Maybe make this an optional to avoid the big predicate below?

844–865

At least some of these seem mutually exclusive, so show that with else if?

I wonder, are all of these mutually exclusive?

danielcdh marked 2 inline comments as done.Jul 26 2017, 10:14 AM
danielcdh added inline comments.
lib/CodeGen/BackendUtil.cpp
844–865

-fprofile-generate, -fprofile-use and -fprofile-sample-use are mutually exclusive.

danielcdh marked an inline comment as done.

update

chandlerc accepted this revision.Jul 27 2017, 2:40 AM

LGTM with a tiny tweak below.

Would be good to add a test that this flag is being honored, either in this patch or in a follow-up.

lib/CodeGen/BackendUtil.cpp
862–863

No need for this? The optional should be disengaged by default when constructed as you do above.

This revision is now accepted and ready to land.Jul 27 2017, 2:40 AM

(Also, sorry for the delay reviewing this, for some reason I thought this already got reviewed and landed...)

danielcdh marked an inline comment as done.Jul 27 2017, 8:30 AM

Thanks for the review!

LGTM with a tiny tweak below.

Would be good to add a test that this flag is being honored, either in this patch or in a follow-up.

I'll add the test in a follow-up patch. Could you help suggest how to add a test for this? Shall I just invoke "clang -cc1 -fexperimental-new-pass-manager" and check if discriminator is generated? That seems an integration test.

danielcdh closed this revision.Jul 27 2017, 8:30 AM