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 ~19% more "returned" arguments.
ADDED: attributor NumAttributesManifested n/a -> 637 ADDED: attributor NumAttributesValidFixpoint n/a -> 25545 ADDED: attributor NumFnArgumentReturned n/a -> 637 ADDED: attributor NumFnKnownReturns n/a -> 25545 ADDED: attributor NumFnUniqueReturned n/a -> 14118 CHANGED: deadargelim NumRetValsEliminated 470 -> 449 ( -4.468%) REMOVED: functionattrs NumReturned 535 -> n/a CHANGED: indvars NumElimIdentity 138 -> 164 ( +18.841%)
I recommend leaving the Clang tests along. Clang tests that run the optimizer don't follow out best practices and, while end-to-end testing is valuable, I don't think that we should encourage general optimizer testing here.