This is an archive of the discontinued LLVM Phabricator instance.

Avoid conflicts between debug-info and pseudo-probe profiling
ClosedPublic

Authored by probinson on Feb 9 2021, 9:50 AM.

Details

Summary

After D93264, using both -fdebug-info-for-profiling and -fpseudo-probe-for-profiling will cause the compiler to crash. Diagnose these conflicting options in the driver.

Also, the driver had a redundant pass-through of the option, and the existing CodeGen test was using the driver when it should be running cc1. Fixed up those as well.

Diff Detail

Event Timeline

probinson requested review of this revision.Feb 9 2021, 9:50 AM
probinson created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 9 2021, 9:50 AM
hoy accepted this revision.Feb 9 2021, 10:29 AM

Thanks for fixing these issues! LGTM.

This revision is now accepted and ready to land.Feb 9 2021, 10:29 AM
This revision was landed with ongoing or failed builds.Feb 10 2021, 7:35 AM
This revision was automatically updated to reflect the committed changes.

the driver had a redundant pass-through of the option

I could've sworn it worked to remove that, but it didn't when I rebased, so that's gone from the final patch (i.e, the explicit pass-through in the driver is still there). It's a functionally separate topic anyway.

@hoy Could you explain a bit further why these two features are incompatible/what the crash looks like? At first glance I wouldn't expect any debug info mode to be incompatible with any non-debug-info mode (maybe less useful, but not crashy levels of incompatible).

hoy added a comment.Feb 16 2021, 12:35 PM

the driver had a redundant pass-through of the option

I could've sworn it worked to remove that, but it didn't when I rebased, so that's gone from the final patch (i.e, the explicit pass-through in the driver is still there). It's a functionally separate topic anyway.

Soung

@hoy Could you explain a bit further why these two features are incompatible/what the crash looks like? At first glance I wouldn't expect any debug info mode to be incompatible with any non-debug-info mode (maybe less useful, but not crashy levels of incompatible).

Both debug-info mode and the pseudo-probe mode use the Dwarf discriminators but for different purposes. Therefore the passes that populate the Dwarf discriminators should not be scheduled at the same time. The crash was like compiler fatal error before this change. It

In D96354#2566502, @hoy wrote:

the driver had a redundant pass-through of the option

I could've sworn it worked to remove that, but it didn't when I rebased, so that's gone from the final patch (i.e, the explicit pass-through in the driver is still there). It's a functionally separate topic anyway.

Soung

@hoy Could you explain a bit further why these two features are incompatible/what the crash looks like? At first glance I wouldn't expect any debug info mode to be incompatible with any non-debug-info mode (maybe less useful, but not crashy levels of incompatible).

Both debug-info mode and the pseudo-probe mode use the Dwarf discriminators but for different purposes. Therefore the passes that populate the Dwarf discriminators should not be scheduled at the same time. The crash was like compiler fatal error before this change. It

Oh, that's subtle and seems somewhat unfortunate. Is that documented somewhere I could read more about?

hoy added a comment.Feb 16 2021, 12:41 PM
In D96354#2566502, @hoy wrote:

the driver had a redundant pass-through of the option

I could've sworn it worked to remove that, but it didn't when I rebased, so that's gone from the final patch (i.e, the explicit pass-through in the driver is still there). It's a functionally separate topic anyway.

Soung

@hoy Could you explain a bit further why these two features are incompatible/what the crash looks like? At first glance I wouldn't expect any debug info mode to be incompatible with any non-debug-info mode (maybe less useful, but not crashy levels of incompatible).

Both debug-info mode and the pseudo-probe mode use the Dwarf discriminators but for different purposes. Therefore the passes that populate the Dwarf discriminators should not be scheduled at the same time. The crash was like compiler fatal error before this change. It

Oh, that's subtle and seems somewhat unfortunate. Is that documented somewhere I could read more about?

The summary of this diff has some information https://reviews.llvm.org/D91756 . Unfortunately we haven't rolled out a formal document yet.