This is an archive of the discontinued LLVM Phabricator instance.

[test] Add Clang side tests for -fdebug-info-for-profiling
ClosedPublic

Authored by MaskRay on Jan 10 2021, 5:44 PM.

Details

Summary

There is currently a driver test but no test for its effect on linkageName & pass pipeline.

Diff Detail

Event Timeline

MaskRay requested review of this revision.Jan 10 2021, 5:44 PM
MaskRay created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 10 2021, 5:44 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
dblaikie added inline comments.Jan 12 2021, 12:17 PM
clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
14–16

What's this test for? (I'd hesitate to add a test that has to run llvm-profdata and use that profile, etc) I guess it's a different codepath that sets up the pass pipeline for this case compared to the previous case?

MaskRay added inline comments.Jan 12 2021, 12:27 PM
clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
14–16

Test that -fdebug-info-for-profiling affects both driver -fprofile-use (CC1 -fprofile-instrument-use-path) and driver -fprofile-generate (CC1 -fprofile-instrument-path). IIUC: generate/use needs to have compatible flags so that their CFG is identical.

The profile reading pass will error on an invalid file (e.g. an empty file).

I hesitated a bit for the usage of llvm-profdata, but I searched for llvm-profdata and there are 20+ other tests using llvm-profdata so I believe it is fine.

dblaikie accepted this revision.Jan 12 2021, 12:34 PM

Sounds good

This revision is now accepted and ready to land.Jan 12 2021, 12:34 PM

Verified with @wmi offline this is good. Committing...