[all-commits] [llvm/llvm-project] 5f57ad: [BasicAA] Remove incorrect rule about constant poi...

Nikita Popov via All-commits all-commits at lists.llvm.org
Wed Jan 17 00:31:13 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5f57ad85a1a7c46eb43eee3c7d93b11d8fd7fcfa
      https://github.com/llvm/llvm-project/commit/5f57ad85a1a7c46eb43eee3c7d93b11d8fd7fcfa
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-01-17 (Wed, 17 Jan 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/AliasAnalysis.h
    M llvm/lib/Analysis/AliasAnalysis.cpp
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    M llvm/test/Analysis/BasicAA/inttoptr_constexpr.ll

  Log Message:
  -----------
  [BasicAA] Remove incorrect rule about constant pointers (#76815)

BasicAA currently says that any Constant cannot alias an identified
local object. This is not correct if the local object escaped, as it's
possible to create a pointer to the escaped object using an inttoptr
constant expression base.

To compensate for this, make sure that inttoptr constant expressions are
treated as escape sources, just like inttoptr instructions. This ensures
that the optimization can still be applied if the local object is
non-escaping. This is sufficient to still optimize the original
motivating case from c53e2ecf0296a55d3c33c19fb70a3aa7f81f2732.

Fixes https://github.com/llvm/llvm-project/issues/76789.




More information about the All-commits mailing list