Page MenuHomePhabricator

Move whole-program virtual call optimization pass after function attribute inference in LTO pipeline.
ClosedPublic

Authored by pcc on May 25 2016, 2:04 PM.

Details

Summary

As a result of D18634 we no longer infer certain attributes on linkonce_odr
functions at compile time, and may only infer them at LTO time. The readnone
attribute in particular is required for virtual constant propagation (part
of whole-program virtual call optimization) to work correctly.

This change moves the whole-program virtual call optimization pass after
the function attribute inference passes, and enables the attribute inference
passes at opt level 1, so that virtual constant propagation has a chance to
work correctly for linkonce_odr functions.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 58503.May 25 2016, 2:04 PM
pcc retitled this revision from to Move whole-program virtual call optimization pass after function attribute inference in LTO pipeline..
pcc updated this object.
pcc added reviewers: pete, mehdi_amini, chandlerc.
pcc added subscribers: llvm-commits, krasin.
pcc updated this revision to Diff 58509.May 25 2016, 2:10 PM
  • Remove an unused declaration
mehdi_amini added inline comments.May 25 2016, 2:15 PM
lib/Transforms/IPO/PassManagerBuilder.cpp
590 ↗(On Diff #58509)

Why is this enable now at O1?

pcc added inline comments.May 25 2016, 2:28 PM
lib/Transforms/IPO/PassManagerBuilder.cpp
590 ↗(On Diff #58509)

My initial thought was that if the user provided profile information, we should probably use it. Although now that I think about it more, it isn't clear that we can make meaningful use of it with our current O1 pipeline, and in any case, that's orthogonal to this change. Disabled.

pcc updated this revision to Diff 58515.May 25 2016, 2:28 PM
  • Disable the ICP pass at O1
mehdi_amini accepted this revision.May 25 2016, 2:29 PM
mehdi_amini edited edge metadata.

LGTM

This revision is now accepted and ready to land.May 25 2016, 2:29 PM
This revision was automatically updated to reflect the committed changes.