[all-commits] [llvm/llvm-project] 104c01: [FunctionAttrs] Only check ArgMem effects when inf...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Oct 19 23:56:23 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 104c01eb31106233b96c38d056e3bb2fbad16c96
      https://github.com/llvm/llvm-project/commit/104c01eb31106233b96c38d056e3bb2fbad16c96
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-10-20 (Fri, 20 Oct 2023)

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

  Log Message:
  -----------
  [FunctionAttrs] Only check ArgMem effects when inferring argument attrs (#69571)

When inferring readonly/writeonly on arguments, if the argument is
passed to a call, we should only check the ArgMem effects implied by the
call -- we don't care whether the call reads/writes non-arg memory
(captured pointers are not relevant here, because they will abort the
analysis entirely).

This also fixes a regression that was introduced when moving to
MemoryEffects: The code was still checking the old WriteOnly attribute
on functions, which no longer exists.




More information about the All-commits mailing list