[all-commits] [llvm/llvm-project] 9a09c7: [BasicAA] Make isNotCapturedBeforeOrAt() check for...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Nov 21 00:28:23 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a09c737a052dc0e2b8c15a969d16cff7ea0c133
      https://github.com/llvm/llvm-project/commit/9a09c737a052dc0e2b8c15a969d16cff7ea0c133
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-11-21 (Tue, 21 Nov 2023)

  Changed paths:
    M llvm/include/llvm/Analysis/AliasAnalysis.h
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    M llvm/test/Transforms/GVN/captured-before.ll

  Log Message:
  -----------
  [BasicAA] Make isNotCapturedBeforeOrAt() check for calls more precise (#69931)

For calls, we are only interested in captures before the call, not
captures by the call itself -- arguments that get passed to the call are
checked explicitly.

In particular, the current implementation is not optimal if the pointer
is captured via a readonly argument -- in that case, we know that even
if the argument is captured, the call will not modify the argument (at
least not via that argument).

Make this more precise by renaming to isCapturedBefore() and adding an
OrAt argument that allows us to toggle whether to consider captures in
the instruction itself or not.




More information about the All-commits mailing list