Page MenuHomePhabricator

[Attributor] Deduce "returned" argument attribute
Needs ReviewPublic

Authored by jdoerfert on Mar 28 2019, 12:04 AM.

Details

Summary

Deduce the "returned" argument attribute by collecting all potentially
returned values.

Note: Not only the unique return value, if any, can be used by
subsequent attributes but also the set of all potentially returned
values as well as the mapping from returned values to return
instructions that they originate from.

Change in statistics (-stats) for LLVM-TS + Spec2006, totaling ~14% more "returned" arguments.

  ADDED: attributor                   NumAttributesManifested                  n/a ->        610                                                                                               
  ADDED: attributor                   NumAttributesValidFixpoint               n/a ->      25385                                                                                               
  ADDED: attributor                   NumFnArgumentReturned                    n/a ->        610                                                                                               
  ADDED: attributor                   NumFnKnownReturns                        n/a ->      25385                                                                                               
  ADDED: attributor                   NumFnUniqueReturned                      n/a ->      13265                                                                                               
REMOVED: functionattrs                NumReturned                              535 ->        n/a
CHANGED: indvars                      NumElimIdentity                          125 ->        151 (   +20.800%)

Event Timeline

jdoerfert created this revision.Mar 28 2019, 12:04 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 28 2019, 12:05 AM
jdoerfert updated this revision to Diff 192738.Mar 28 2019, 4:39 PM

Fix the last bug exposed by llvm-test-suite & SPEC2006

jdoerfert updated this revision to Diff 192916.Mar 29 2019, 2:44 PM

Minor updates

xbolva00 added inline comments.
llvm/lib/Transforms/IPO/Attributor.cpp
437

Maybe enum here ?
So you could call indicateFixpoint(Fixpoint::optimistic) ?

Or maybe even better, indicateOptimisticFixpoint()?

jdoerfert edited the summary of this revision. (Show Details)Apr 1 2019, 8:07 AM
jdoerfert marked an inline comment as done.
jdoerfert added inline comments.
llvm/lib/Transforms/IPO/Attributor.cpp
437

Good points. I'll probably go with the second, most explicit, solution. I'll update (all) the source files soon.

jdoerfert updated this revision to Diff 193115.Apr 1 2019, 9:54 AM

Minor changes

sanjoy removed a reviewer: sanjoy.Apr 1 2019, 11:05 AM
fhahn added a subscriber: fhahn.Apr 12 2019, 3:14 AM
jdoerfert marked an inline comment as done.Apr 15 2019, 10:05 AM
jdoerfert added inline comments.
llvm/lib/Transforms/IPO/Attributor.cpp
494

This should probably call llvm_unreachable with a message instead of returning -1.

jdoerfert updated this revision to Diff 199114.Fri, May 10, 6:09 PM

Rebase on newest Attributor design