[all-commits] [llvm/llvm-project] 79f414: [mlir][Transforms] Dialect conversion: Move `hasRe...

Matthias Springer via All-commits all-commits at lists.llvm.org
Fri Dec 13 02:26:33 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 79f41434460d3305c889a6483ea59f1e3ea19b5a
      https://github.com/llvm/llvm-project/commit/79f41434460d3305c889a6483ea59f1e3ea19b5a
  Author: Matthias Springer <me at m-sp.org>
  Date:   2024-12-13 (Fri, 13 Dec 2024)

  Changed paths:
    M mlir/lib/Transforms/Utils/DialectConversion.cpp

  Log Message:
  -----------
  [mlir][Transforms] Dialect conversion: Move `hasRewrite` to expensive checks (#119848)

The dialect conversion has various checks that detect incorrect API
usage in patterns. One of these checks turned out to be quite expensive
(N*M complexity where N is the number of block rewrites and M is the
total number of rewrites) in NVIDIA-internal workloads: Checking that a
block is not converted multiple times.

This check iterates over the stack of all rewrites, which can be large.
We saw `hasRewrite` being called around 45000 times with an average
rewrite stack size of 500000.

This PR moves the check to `MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS`.
For consistency reasons, the other `hasRewrite`-based check is also
moved there.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list