[all-commits] [llvm/llvm-project] e2cc09: Fix a missed opportunity to merge stores.

Nadav Rotem via All-commits all-commits at lists.llvm.org
Mon Jan 10 13:49:38 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e2cc091a7d01fc3a3d226e206f00f029c9e3e079
      https://github.com/llvm/llvm-project/commit/e2cc091a7d01fc3a3d226e206f00f029c9e3e079
  Author: Nadav Rotem <nadav256 at gmail.com>
  Date:   2022-01-10 (Mon, 10 Jan 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/test/CodeGen/Hexagon/store-widen-aliased-load.ll
    M llvm/test/CodeGen/PowerPC/mma-acc-memops.ll
    M llvm/test/CodeGen/X86/MergeConsecutiveStores.ll

  Log Message:
  -----------
  Fix a missed opportunity to merge stores.

This commit fixes a missed opportunity in merging consecutive stores.
The code that searches for stores skipped the case of stores that
directly connect to the root. The comment above the implementation lists
this case but the code did not handle it. I found this pattern when
looking into the shared_ptr destructor. GCC generates the right
sequence. Here is a small repo:

    int foo(int* buff) {
        buff[0] = 0;
        int x = buff[1];
        buff[1] = 0;
        return x;
    }

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




More information about the All-commits mailing list