This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Look at internal functions only on-demand
ClosedPublic

Authored by jdoerfert on Aug 28 2019, 4:31 PM.

Details

Summary

Instead of building attributes for internal functions which we do not
update as long as we assume they are dead, we now do not create
attributes until we assume the internal function to be live. This
improves the number of required iterations, as well as the number of
required updates, in real code. On our tests, the results are mixed.

Diff Detail

Repository
rL LLVM

Event Timeline

jdoerfert created this revision.Aug 28 2019, 4:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2019, 4:31 PM
jdoerfert updated this revision to Diff 217765.Aug 28 2019, 8:52 PM

Update tests

uenoku added inline comments.Aug 28 2019, 10:30 PM
llvm/lib/Transforms/IPO/Attributor.cpp
144–155 ↗(On Diff #217765)

Is AADummy used in this patch? What is the purpose?

llvm/test/Transforms/FunctionAttrs/align.ll
1 ↗(On Diff #217765)

Why does max-iterations increase?

jdoerfert marked 2 inline comments as done.Aug 29 2019, 5:58 AM
jdoerfert added inline comments.
llvm/lib/Transforms/IPO/Attributor.cpp
144–155 ↗(On Diff #217765)

It was, then I removed the use -.-, will remove the dummy AA as well. Was used as QueryingAA but no need anymore.

llvm/test/Transforms/FunctionAttrs/align.ll
1 ↗(On Diff #217765)

Because we look at internal functions later. That should not increase the overall time spend or number of total updates. Once these patches are through I'll also add a test I distilled from a benchmark to verify we keep a low number of iterations in an actual "corner case" that exists.

uenoku accepted this revision.Aug 29 2019, 11:55 AM

LGTM

This revision is now accepted and ready to land.Aug 29 2019, 11:55 AM
This revision was automatically updated to reflect the committed changes.