[all-commits] [llvm/llvm-project] cf602b: [flang] handle fir.call in AliasAnalysis::getModRe...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Nov 26 02:17:55 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cf602b95d14532fdb97679806bc5ba9d55631875
      https://github.com/llvm/llvm-project/commit/cf602b95d14532fdb97679806bc5ba9d55631875
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2024-11-26 (Tue, 26 Nov 2024)

  Changed paths:
    M flang/include/flang/Optimizer/Analysis/AliasAnalysis.h
    M flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
    M flang/lib/Optimizer/Analysis/CMakeLists.txt
    M flang/lib/Optimizer/Transforms/AddAliasTags.cpp
    A flang/test/Analysis/AliasAnalysis/gen_mod_ref_test.py
    A flang/test/Analysis/AliasAnalysis/modref-call-after-inlining.fir
    A flang/test/Analysis/AliasAnalysis/modref-call-args.f90
    A flang/test/Analysis/AliasAnalysis/modref-call-dummies.f90
    A flang/test/Analysis/AliasAnalysis/modref-call-equivalence.f90
    A flang/test/Analysis/AliasAnalysis/modref-call-globals.f90
    A flang/test/Analysis/AliasAnalysis/modref-call-internal-proc.f90
    A flang/test/Analysis/AliasAnalysis/modref-call-locals.f90
    A flang/test/Analysis/AliasAnalysis/modref-call-not-fortran.fir

  Log Message:
  -----------
  [flang] handle fir.call in AliasAnalysis::getModRef (#117164)

fir.call side effects are hard to describe in a useful way using
`MemoryEffectOpInterface` because it is impossible to list which memory
location a user procedure read/write without doing a data flow analysis
of its body (even PURE procedures may read from any module variable,
Fortran SIMPLE procedure from F2023 will allow that, but they are far
from common at that point).

Fortran language specifications allow the compiler to deduce
that a procedure call cannot access a variable in many cases 
This patch leverages this to extend `fir::AliasAnalysis::getModRef` to
deal with fir.call.

This will allow implementing "array = array_function()" optimization in
a future patch.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list