This is an archive of the discontinued LLVM Phabricator instance.

[InstrProf] Allow CSIRPGO function entry coverage
ClosedPublic

Authored by ellis on Jul 8 2022, 3:56 PM.

Details

Summary

The flag -fcs-profile-generate for enabling CSIRPGO moves the pass
pgo-instrumentation after inlining. Function entry coverage works fine
with this change, so remove the assert. I had originally left this
assert in because I had not tested this at the time.

Diff Detail

Event Timeline

ellis created this revision.Jul 8 2022, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2022, 3:56 PM
ellis retitled this revision from [instrprof] Allow CSIRPGO function entry coverage to [InstrProf] Allow CSIRPGO function entry coverage.Jul 11 2022, 10:28 AM
ellis edited the summary of this revision. (Show Details)
ellis added reviewers: kyulee, phosek, davidxl, MaskRay.
ellis published this revision for review.Jul 11 2022, 10:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 10:30 AM

Is there a test covering this?

Is there a test covering this?

The only different between -fprofile-generate and -fcs-profile-generate is when the pgo-instr-gen pass is added, so I don't think an explicit test is necessary. We have lots of tests in test/Transforms/PGOProfile that use opt < %s -passes=pgo-instr-gen that uses this code to inject the llvm.instrprof intrinsics, but I couldn't find test that trigger this using the frontend flags.

That being said, I would be happy to add some tests if that's what we want. I think it would need to be a clang test that checks if the instrumentation code is injected correctly.

ellis updated this revision to Diff 444372.Jul 13 2022, 11:57 AM

Test CSIRPGO + function coverage and refactor substitutions in compiler-rt/test/profile.

Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 11:57 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript

Friendly ping

This revision is now accepted and ready to land.Jul 18 2022, 10:14 AM
MaskRay accepted this revision.Jul 18 2022, 10:18 AM

LGTM.

This revision was landed with ongoing or failed builds.Jul 18 2022, 3:10 PM
This revision was automatically updated to reflect the committed changes.