[all-commits] [llvm/llvm-project] 7c229f: [GVN] Invalidate MDA when deduplicating phi nodes

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Sep 14 22:04:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7c229f6e85478bb0626a5e598f47b7be94bb50b0
      https://github.com/llvm/llvm-project/commit/7c229f6e85478bb0626a5e598f47b7be94bb50b0
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-09-15 (Fri, 15 Sep 2023)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/Local.h
    M llvm/lib/Transforms/Scalar/GVN.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    A llvm/test/Transforms/GVN/pr64598.ll

  Log Message:
  -----------
  [GVN] Invalidate MDA when deduplicating phi nodes

Duplicate phi nodes were being directly removed, without
invalidating MDA. This could result in a new phi node being
allocated at the same address, incorrectly reusing a cache entry.

Fix this by optionally allowing EliminateDuplicatePHINodes() to
collect phi nodes to remove into a vector, which allows GVN to
handle removal itself.

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

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




More information about the All-commits mailing list