[Attributor] Fix TODO to avoid recomputation of results
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 30 Jan 2020 00:02:42 +0000 (18:02 -0600)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 30 Jan 2020 01:24:34 +0000 (19:24 -0600)
commit791c9f1145f89d0ad8daddcc2207a8cdacbadaa0
tree7e35b058127261a4a2c6cd469cbaac0ac1fe26c8
parent91f863be4f04337da19c26c4fbda4ce10bfc0668
[Attributor] Fix TODO to avoid recomputation of results

The helpers AAReturnedFromReturnedValues and
AACallSiteReturnedFromReturned are useful not only to avoid code
duplication but also to avoid recomputation of results. If we have N
call sites we should not recompute the function return information N
times but once. These are mostly straightforward usages with some minor
improvements on the helpers and addition of a new one
(IRPosition::getAssociatedType) that knows about function return types.
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp