This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Make indirect call promotion a utility
ClosedPublic

Authored by mssimpso on Nov 30 2017, 9:50 AM.

Details

Summary

This patch factors out the main code transformation utilities in the pgo-driven indirect call promotion pass and places them in Transforms/Utils. The change is intended to be a non-functional change, letting non-pgo-driven passes share a common implementation with the existing pgo-driven pass.

The common utilities are used to conditionally promote indirect call sites to direct call sites. They perform the underlying transformation, and do not consider profile information. The pgo-specific details (e.g., the computation of branch weight metadata) have been left in the indirect call promotion pass.

Diff Detail

Repository
rL LLVM

Event Timeline

mssimpso created this revision.Nov 30 2017, 9:50 AM
davidxl edited edge metadata.Nov 30 2017, 9:56 AM

Can you make this patch a pure NFC one and split out the enhancement part into another patch?

Can you make this patch a pure NFC one and split out the enhancement part into another patch?

Will do. Thanks, David.

mssimpso updated this revision to Diff 125198.Dec 1 2017, 1:25 PM
mssimpso edited the summary of this revision. (Show Details)

Made this patch NFC and split out the functional changes.

davidxl accepted this revision.Dec 1 2017, 1:29 PM

lgtm

This revision is now accepted and ready to land.Dec 1 2017, 1:29 PM
davide accepted this revision.Dec 1 2017, 1:31 PM

I'm fine with this but David Li (or other PGO people) should take a look as well. Thanks.

This revision was automatically updated to reflect the committed changes.