[all-commits] [llvm/llvm-project] b49312: [MemorySSA] Support invariant.group metadata

aeubanks via All-commits all-commits at lists.llvm.org
Wed Sep 8 13:06:39 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b493124ae2de5074acc8207155274f84732cd06b
      https://github.com/llvm/llvm-project/commit/b493124ae2de5074acc8207155274f84732cd06b
  Author: Arthur Eubanks <aeubanks at google.com>
  Date:   2021-09-08 (Wed, 08 Sep 2021)

  Changed paths:
    M llvm/lib/Analysis/MemorySSA.cpp
    M llvm/test/Analysis/MemorySSA/invariant-groups.ll
    R llvm/test/Transforms/NewGVN/invariant.group-xfail.ll
    A llvm/test/Transforms/NewGVN/invariant.group.ll
    M llvm/unittests/Analysis/MemorySSATest.cpp

  Log Message:
  -----------
  [MemorySSA] Support invariant.group metadata

The implementation is mostly copied from MemDepAnalysis. We want to look
at all loads and stores to the same pointer operand. Bitcasts and zero
GEPs of a pointer are considered the same pointer value. We choose the
most dominating instruction.

Since updating MemorySSA with invariant.group is non-trivial, for now
handling of invariant.group is not cached in any way, so it's part of
the walker. The number of loads/stores with invariant.group is small for
now anyway. We can revisit if this actually noticeably affects compile
times.

To avoid invariant.group affecting optimized uses, we need to have
optimizeUsesInBlock() not use invariant.group in any way.

Co-authored-by: Piotr Padlewski <prazek at google.com>

Reviewed By: asbirlea, nikic, Prazek

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




More information about the All-commits mailing list