[all-commits] [llvm/llvm-project] 5bd817: [AA] A global cannot escape through nocapture/noca...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Mon Nov 28 12:58:00 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5bd8175dd70416221c58c3c92f06886427680cb5
      https://github.com/llvm/llvm-project/commit/5bd8175dd70416221c58c3c92f06886427680cb5
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2022-11-28 (Mon, 28 Nov 2022)

  Changed paths:
    M llvm/lib/Analysis/GlobalsModRef.cpp
    A llvm/test/Analysis/GlobalsModRef/noescape-nocapture-nocallback.ll

  Log Message:
  -----------
  [AA] A global cannot escape through nocapture/nocallback call.

When an internal global is passed to a 'nocallback' call as
a 'nocapture' pointer, it cannot escape through this call and
be indirectly referenced in this module.
So it must not alias with any pointer in the module.

This may provide some remedy for Fortran module-private array descriptors
that are usually passed by address to some runtime functions
(e.g. to allocation/deallocation functions). In general, a good aliasing
information derived from Fortran language rules would solve the same issue,
but I think this change may be beneficial as-is (given that nocapture,
nocallback attributes are properly set).

Reviewed By: jdoerfert

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




More information about the All-commits mailing list