[all-commits] [llvm/llvm-project] f44f60: [Attributor] Avoid replacing return operands twice

Johannes Doerfert via All-commits all-commits at lists.llvm.org
Fri Mar 11 19:55:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f44f60a297c69c603b3d473ca0cf0f8c06b93d32
      https://github.com/llvm/llvm-project/commit/f44f60a297c69c603b3d473ca0cf0f8c06b93d32
  Author: Johannes Doerfert <johannes at jdoerfert.de>
  Date:   2022-03-11 (Fri, 11 Mar 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll
    M llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll
    M llvm/test/Transforms/Attributor/depgraph.ll
    M llvm/test/Transforms/Attributor/liveness.ll
    M llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll
    M llvm/test/Transforms/Attributor/lvi-for-ashr.ll
    M llvm/test/Transforms/Attributor/nocapture-2.ll
    M llvm/test/Transforms/Attributor/nonnull.ll
    M llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll
    M llvm/test/Transforms/Attributor/undefined_behavior.ll

  Log Message:
  -----------
  [Attributor] Avoid replacing return operands twice

As replacements will become more complex it is better to have a single
AA responsible for replacing a use. Before this patch AAValueSimplify*
and AAValueSimplifyReturned could both try to replace the returned
value. The latter was marginally better for the old pass manager
when a function was already carrying a `returned` attribute and when
the context of the return instruction was important. The second
shortcoming was resolved by looking for return attributes in the
AAValueSimplifyCallSiteReturned initialization. The old PM impact is
not concerning.

This is yet another step towards the removal of AAReturnedValues, the
very first AA we should now try to eliminate due to the overlapping
logic with value simplification.




More information about the All-commits mailing list