This is an archive of the discontinued LLVM Phabricator instance.

[test] Simplify pr33641_remove_arg_dbgvalue.ll
ClosedPublic

Authored by aeubanks on Oct 21 2020, 8:52 AM.

Details

Summary

This makes it pass under the NPM.
The legacy PM pass ran passes on SCCs in a different order, causing
argpromotion to not trigger on @bar().

Diff Detail

Event Timeline

aeubanks created this revision.Oct 21 2020, 8:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 21 2020, 8:52 AM
aeubanks requested review of this revision.Oct 21 2020, 8:52 AM
rnk added a comment.Oct 22 2020, 12:15 PM

The legacy PM pass ran passes on SCCs in a different order, causing
argpromotion to not trigger on @bar().

I see, so DSE would run, then bar would become unreferenced, and then there would be no reason to promote arguments?

llvm/test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll
23

I think it's generally good practice to keep around some CHECK lines for context, like this define @bar line. It helps to make the test more robust to future modifications that add code later with more dbg.values that might match this CHECK here.

aeubanks updated this revision to Diff 300152.Oct 22 2020, 7:48 PM

add context CHECK

In D89889#2348178, @rnk wrote:

The legacy PM pass ran passes on SCCs in a different order, causing
argpromotion to not trigger on @bar().

I see, so DSE would run, then bar would become unreferenced, and then there would be no reason to promote arguments?

Actually, the legacy PM first ran passes on @foo(), then @bar() arbitrarily since it doesn't keep track of function references, only direct calls. In the NPM, it sees the reference of @bar() in @foo(), so properly first runs passes on @bar() then @foo().

rnk accepted this revision.Oct 23 2020, 12:51 PM

lgtm

This revision is now accepted and ready to land.Oct 23 2020, 12:51 PM
This revision was landed with ongoing or failed builds.Oct 23 2020, 3:36 PM
This revision was automatically updated to reflect the committed changes.