[all-commits] [llvm/llvm-project] 016411: [MLIR] Remove TableGen redundant calls to native c...

Alexandre Eichenberger via All-commits all-commits at lists.llvm.org
Mon Jun 22 08:12:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 01641197ee0bd3895c756c925723c8c8e03bcb09
      https://github.com/llvm/llvm-project/commit/01641197ee0bd3895c756c925723c8c8e03bcb09
  Author: AlexEichenberger <alexeichenberger at gmail.com>
  Date:   2020-06-22 (Mon, 22 Jun 2020)

  Changed paths:
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp
    M mlir/test/mlir-tblgen/pattern.mlir
    M mlir/tools/mlir-tblgen/RewriterGen.cpp

  Log Message:
  -----------
  [MLIR] Remove TableGen redundant calls to native calls when creating new operations in DRR TableGen files

Summary:
Currently, the TableGen rewrite generates redundant native calls in MLIR DRR files. This is a problem as some native calls may involve significant computations (e.g. when performing constant propagation where every values in a large tensor is touched).

The pattern was as follow:

```c++
if (native-call(args)) tblgen_attrs.emplace_back(rewriter, attribute, native-call(args))
```

The replacement pattern compute `native-call(args)` once and then use it both in the `if` condition and the `emplace_back` call.

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




More information about the All-commits mailing list