This is an archive of the discontinued LLVM Phabricator instance.

[PM] Port ArgumentPromotion to the new pass manager.
ClosedPublic

Authored by chandlerc on Feb 6 2017, 2:22 AM.

Details

Summary

Now that the call graph supports efficient replacement of a function and
spurious reference edges, we can port ArgumentPromotion to the new pass
manager very easily.

The old PM-specific bits are sunk into callbacks that the new PM simply
doesn't use. Unlike the old PM, the new PM simply does argument
promotion and afterward does the update to LCG reflecting the promoted
function.

Depends on D29579.

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc created this revision.Feb 6 2017, 2:22 AM
davide accepted this revision.Feb 7 2017, 11:39 AM

Still I would really like these tests to use FileCheck instead of grep and check more, but I don't think it makes sense holding a review just for that. I would like to see the output to be checked for some tests (inlined), other than that I'm fine with this patch. Thanks!

test/Transforms/ArgumentPromotion/callgraph-update.ll
1–2 ↗(On Diff #87205)

Can you check the output is the same here?

test/Transforms/ArgumentPromotion/crash.ll
1–2 ↗(On Diff #87205)

Can you check the output is the same here?

test/Transforms/ArgumentPromotion/reserve-tbaa.ll
1–2 ↗(On Diff #87205)

Can you check the output is the same here? This old test doesn't even check for it.

This revision is now accepted and ready to land.Feb 7 2017, 11:39 AM

Still I would really like these tests to use FileCheck instead of grep and check more, but I don't think it makes sense holding a review just for that. I would like to see the output to be checked for some tests (inlined), other than that I'm fine with this patch. Thanks!

Sorry, I tried to do this already and just missed some cases. I've addressed all of them now. One test I just deleted because we actually didn't argument promote anything there, but the rest are now FileCheck based. =]

chandlerc updated this revision to Diff 87609.Feb 8 2017, 1:17 AM

Rebase now that we actually don't have grep testing here.

Confirmed with Davide that this LGTM now on IRC, landing.

This revision was automatically updated to reflect the committed changes.