[all-commits] [llvm/llvm-project] 412141: Reapply [FunctionAttrs] Infer precise FMRB

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Sep 29 05:03:29 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 412141663cfcc7883c24217bcb88780e4572543b
      https://github.com/llvm/llvm-project/commit/412141663cfcc7883c24217bcb88780e4572543b
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-09-29 (Thu, 29 Sep 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/FunctionAttrs.cpp
    M llvm/test/Transforms/FunctionAttrs/argmemonly.ll

  Log Message:
  -----------
  Reapply [FunctionAttrs] Infer precise FMRB

The previous version of the patch would incorrect convert an
existing argmemonly attribute into an inaccessiblemem_or_argmemonly
attribute.

-----

This updates checkFunctionMemoryAccess() to infer a precise
FunctionModRefBehavior, rather than an approximation split into
read/write and argmemonly.

Afterwards, we still map this back to imprecise function attributes.
This still allows us to infer some cases that we previously did not
handle, namely inaccessiblememonly and inaccessiblemem_or_argmemonly.
In practice, this means we get better memory attributes in the
presence of intrinsics like @llvm.assume.

Differential Revision: https://reviews.llvm.org/D134527




More information about the All-commits mailing list