This is an archive of the discontinued LLVM Phabricator instance.

[PM] Add pgo-memop-opt pass to the new pass manager
ClosedPublic

Authored by xur on Oct 20 2017, 2:41 PM.

Details

Summary

This pass adds pgo-memop-opt pass to the new pass manager.
It is in the old pass manager but somehow left out in the new pass manager.

Diff Detail

Event Timeline

xur created this revision.Oct 20 2017, 2:41 PM
davide requested changes to this revision.Oct 20 2017, 2:46 PM
davide added a subscriber: davide.

Is it expected that we run this pass in the default -O1/-O2 pipeline?
I thought this was enabled only when -fprofile-instr-{generate/use} is specified.

This revision now requires changes to proceed.Oct 20 2017, 2:46 PM
davidxl added inline comments.Oct 20 2017, 3:14 PM
lib/Passes/PassBuilder.cpp
365

check PGOOpt && !PGOOpt->ProfileUseFile.empty()

xur updated this revision to Diff 119718.Oct 20 2017, 3:24 PM
xur edited edge metadata.

Thanks for the review. Here is the updated patch.

Don't we have a test for this? We should (I thought the PGO pipeline was tested, if it's not, you can probably add a test in a follow-up)

davidxl added inline comments.Oct 20 2017, 3:28 PM
lib/Passes/PassBuilder.cpp
366

Should checkProfileUseFile instead of SampleProfileFile.

xur updated this revision to Diff 119916.Oct 23 2017, 12:40 PM

Updated the patch with review comments.

@davidxl: I meant to use PGOOpt->SampleProfileFile.empty(), instead of !PGOOpt->SampleProfileFile.empty().
But !PGOOpt->ProfileUseFile.empty() is definitely better here.

@davide: Added the check in PGO use pipeline.

Thanks!

davide accepted this revision.Oct 23 2017, 12:41 PM

LGTM now, thanks.

This revision is now accepted and ready to land.Oct 23 2017, 12:41 PM
davide added inline comments.Oct 23 2017, 12:42 PM
lib/Passes/PassBuilder.cpp
365

Bonus point if you add a comment :)

davidxl accepted this revision.Oct 23 2017, 2:18 PM

lgtm

This revision was automatically updated to reflect the committed changes.