[all-commits] [llvm/llvm-project] d734ed: [MemDep] Reduce block limit

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jan 13 01:40:48 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d734edfe7c13d1b8e32d75a5df897ef0d9b69302
      https://github.com/llvm/llvm-project/commit/d734edfe7c13d1b8e32d75a5df897ef0d9b69302
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-01-13 (Fri, 13 Jan 2023)

  Changed paths:
    M llvm/lib/Analysis/MemoryDependenceAnalysis.cpp

  Log Message:
  -----------
  [MemDep] Reduce block limit

The non-local MemDep analysis has a limit on the number of blocks
it will scan trying to find dependencies. The current limit of 1000
is very high, especially when we consider that each block scan can
also visit up to 100 instructions. In degenerate cases (where we
actually scan that many blocks) MemDep/GVN dominate overall
compile-time, for little benefit.

This patch reduces the limit to 200, which is probably still too
large, but at least mitigates some of the more catastrophic cases.
(For comparison, MSSA clobber walks consider up to 100
MemoryDefs/MemoryPhis, rather than 200 blocks * 100 instructions,
but these limits aren't directly comparable.)

I know that we were kind of hoping that this issue would resolve
itself in time, either by a switch to NewGVN or use of MSSA in GVN.
But I think we should still address this in the meantime.
Additionally, a switch to an MSSA-based implementation will
effectively be doing this as well, in a roundabout way (by dint of
MSSA having lower cutoffs than MDA).

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




More information about the All-commits mailing list