[PATCH] D154917: [Attributor] Replace AAReturnedValues with AAPotentialValuesReturned

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 22:06:59 PDT 2023


jdoerfert created this revision.
jdoerfert added reviewers: nikic, jhuber6, tianshilei1992, arsenm, kuter.
Herald added subscribers: hoy, ormris, StephenFan, okura, bollu, hiraditya.
Herald added a reviewer: homerdin.
Herald added a project: All.
jdoerfert requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, wdng.
Herald added a reviewer: sstefan1.
Herald added a project: LLVM.

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


https://reviews.llvm.org/D154917

Files:
  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/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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154917.538913.patch
Type: text/x-patch
Size: 84358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230711/18a24832/attachment.bin>


More information about the llvm-commits mailing list