This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Deduce attributes for non-exact functions
ClosedPublic

Authored by bbn on Mar 18 2020, 7:58 PM.

Details

Summary

This patch is based on D63312 and D63319. For now we create shallow wrappers for all functions that are IPO amendable.
See also this github issue.

Diff Detail

Event Timeline

bbn created this revision.Mar 18 2020, 7:58 PM
bbn set the repository for this revision to rG LLVM Github Monorepo.Mar 18 2020, 7:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2020, 7:59 PM
bbn updated this revision to Diff 251253.Mar 18 2020, 8:29 PM

Updated createShallowWrapper() function

bbn updated this revision to Diff 251359.Mar 19 2020, 5:57 AM
  • Added tests
  • Added noinline attribute to call site to prevent the internal function being inlined
kuter added a subscriber: kuter.Mar 19 2020, 5:31 PM
jdoerfert added inline comments.Mar 19 2020, 5:34 PM
llvm/test/Transforms/Attributor/wrapper.ll
1 ↗(On Diff #251359)

run it with the new pass manager as well -passes=attributor and verify we set the norecurse attribute on the wrapped functions.

16 ↗(On Diff #251359)

add the name of the function, even if it is @0 or something. Here and above at the call site.

bbn marked an inline comment as done.Mar 19 2020, 9:07 PM
bbn added inline comments.
llvm/test/Transforms/Attributor/wrapper.ll
1 ↗(On Diff #251359)

did you mean -passes=attributor-cgscc ?

bbn updated this revision to Diff 251561.Mar 20 2020, 12:15 AM
  • update tests
jdoerfert accepted this revision.Mar 20 2020, 9:46 AM

Two nits, otherwise LGTM.

llvm/lib/Transforms/IPO/Attributor.cpp
62

NumAttrsRequiredDeepWrapper is not used, or is it?

llvm/test/Transforms/Attributor/wrapper.ll
5 ↗(On Diff #251561)

Add a CHECK-NOT: Function Attrs before this line.

1 ↗(On Diff #251359)

Yes, sorry for the confusion.

This revision is now accepted and ready to land.Mar 20 2020, 9:46 AM

Adjust the commit title please.

bbn updated this revision to Diff 251810.Mar 20 2020, 5:26 PM
bbn retitled this revision from [WIP][Attributor] Deduce attributes for non-exact functions to [Attributor] Deduce attributes for non-exact functions.
  • added some CHECK-NOT to tests
  • deleted unused statistic

Apologies for the delay, can you rebase this and provide me with "Firstname Lastname <email>" from you so I can attribute it to you?

bbn updated this revision to Diff 254397.Apr 1 2020, 7:27 PM

Rebased patch.

bbn added a comment.Apr 1 2020, 7:28 PM

Apologies for the delay, can you rebase this and provide me with "Firstname Lastname <email>" from you so I can attribute it to you?

"Luofan Chen <clfbbn@gmail.com>"

Thanks!

This revision was automatically updated to reflect the committed changes.