[Attributor] Replace AAReturnedValues with AAPotentialValuesReturned
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 20 Jun 2023 23:43:24 +0000 (16:43 -0700)
committerJohannes Doerfert <johannes@jdoerfert.de>
Mon, 17 Jul 2023 17:43:23 +0000 (10:43 -0700)
commitf26d05d306a2dafefb82dc2a98e267b96f06390d
tree908a8ff4760e2bc47967b79f23e3e3597cc2d0ff
parenta5d194e9755d25d9272fbc72cac9ea3b455ba672
[Attributor] Replace AAReturnedValues with AAPotentialValuesReturned

The very first AA, at least the first one in order, is not necessary
anymore. `AAReturnedValues` was from a different time; one might say, a
simpler time.

It was rewriten once to use `Attribute::getAssumedSimplifiedValues`,
which is what the replacement, `AAPotentialValuesReturned`, does too.
To match the old behavior we needed to avoid the helper
`AAReturnedFromReturnedValues` and iterate the return instructions
explicitly, however, it is still less complexity than it was before.
`AAReturnedFromReturnedValues` and `getAssumedSimplifiedValues` now
allow users to stop at PHI and select nodes or to ignore those and look
through. `AANoFPClass` will stop at select and phi nodes to read the
fast math flags.

Fixes: https://github.com/llvm/llvm-project/issues/63404

Differential Revision: https://reviews.llvm.org/D154917
13 files changed:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll
llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll
llvm/test/Transforms/Attributor/depgraph.ll
llvm/test/Transforms/Attributor/nocapture-1.ll
llvm/test/Transforms/Attributor/nofpclass-select.ll
llvm/test/Transforms/Attributor/potential.ll
llvm/test/Transforms/Attributor/range.ll
llvm/test/Transforms/Attributor/readattrs.ll
llvm/test/Transforms/Attributor/returned.ll
llvm/test/Transforms/Attributor/value-simplify.ll