Page MenuHomePhabricator

[Attributor] Use liveness during the creation of AAReturnedValues
ClosedPublic

Authored by jdoerfert on Mon, Aug 12, 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.

Diff Detail

Repository
rL LLVM

Event Timeline

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

LGTM.

llvm/lib/Transforms/IPO/Attributor.cpp
124 ↗(On Diff #214737)

This comment is now outdated.

This revision is now accepted and ready to land.Tue, Aug 13, 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

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.Wed, Aug 14, 4:43 PM
jdoerfert added inline comments.
llvm/trunk/lib/Transforms/IPO/Attributor.cpp
730

I saw it and fixed it. Thx for reporting!