This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Use liveness during the creation of AAReturnedValues
ClosedPublic

Authored by jdoerfert on Aug 12 2019, 4:26 PM.

Details

Summary

As one of the first attributes, and one of the complex ones,
AAReturnedValues was not using liveness but we filtered the result after
the fact. This change adds liveness usage during the creation. The
algorithm is also improved and shorter.

The new algorithm will collect returned values over time using the
generic facilities that work with liveness already, e.g.,
genericValueTraversal which does not look at dead PHI node predecessors.
A test to show how this leads to better results is included.

Note: Unresolved calls and resolved calls are now tracked explicitly.

Event Timeline

jdoerfert created this revision.Aug 12 2019, 4:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2019, 4:26 PM
sstefan1 accepted this revision.Aug 13 2019, 3:44 PM

LGTM.

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

This comment is now outdated.

This revision is now accepted and ready to land.Aug 13 2019, 3:44 PM
This revision was automatically updated to reflect the committed changes.
rupprecht added inline comments.
llvm/trunk/lib/Transforms/IPO/Attributor.cpp
730 ↗(On Diff #215250)

This introduces a new warning due to omitting the RetInsts field here:

[956/4588] Building CXX object lib/Transforms/IPO/CMakeFiles/LLVMipo.dir/Attributor.cpp.o
~/src/llvm-project/llvm/lib/Transforms/IPO/Attributor.cpp:738:39: warning: missing field 'RetInsts' initializer [-Wmissing-field-initializers]                                                                
    RVState RVS({ReturnedValues, false});
jdoerfert marked an inline comment as done.Aug 14 2019, 4:43 PM
jdoerfert added inline comments.
llvm/trunk/lib/Transforms/IPO/Attributor.cpp
730 ↗(On Diff #215250)

I saw it and fixed it. Thx for reporting!