Page MenuHomePhabricator

[Attributor] Deduce attributes for non-exact functions
AcceptedPublic

Authored by bbn on Wed, Mar 18, 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.Wed, Mar 18, 7:58 PM
bbn set the repository for this revision to rG LLVM Github Monorepo.Wed, Mar 18, 7:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Mar 18, 7:59 PM
bbn updated this revision to Diff 251253.Wed, Mar 18, 8:29 PM

Updated createShallowWrapper() function

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

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

17

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.Thu, Mar 19, 9:07 PM
bbn added inline comments.
llvm/test/Transforms/Attributor/wrapper.ll
2

did you mean -passes=attributor-cgscc ?

bbn updated this revision to Diff 251561.Fri, Mar 20, 12:15 AM
  • update tests
jdoerfert accepted this revision.Fri, Mar 20, 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
2

Yes, sorry for the confusion.

6

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

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

Adjust the commit title please.

bbn updated this revision to Diff 251810.Fri, Mar 20, 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