[PATCH] D79208: [mlir][EDSC] Make use of InsertGuard

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 15:06:41 PDT 2020


nicolasvasilache created this revision.
nicolasvasilache added a reviewer: rriddle.
Herald added subscribers: llvm-commits, Kayjukh, frgossen, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, jpienaar, mehdi_amini, dexonsmith, steven_wu, hiraditya, mgorny.
Herald added a reviewer: aartbik.
Herald added a reviewer: ftynse.
Herald added a project: LLVM.
rriddle accepted this revision.
rriddle marked an inline comment as done.
This revision is now accepted and ready to land.
nicolasvasilache updated this revision to Diff 261367.
nicolasvasilache added a comment.
nicolasvasilache updated this revision to Diff 261368.

ADdress comment.


nicolasvasilache added a comment.

Update.



================
Comment at: mlir/lib/EDSC/Builders.cpp:86
+                                                   res.block->begin());
+  for (auto t : argTypes)
     res.block->addArgument(t);
----------------
You should be able to just do `res.block->addArguments(argTypes)`


This revision cleans up a layer of complexity in ScopedContext and uses InsertGuard instead of previously manual bookkeeping.
The method `getBuilder` is renamed to `getBuilderRef` and spurious copies of OpBuilder are tracked.

This results in some canonicalizations not happening anymore in the Linalg matmul to vector test. This test is retired because relying on DRRs for this has been shaky at best. The solution will be better support to write fused passes in C++ with more idiomatic pattern composition and application.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79208

Files:
  mlir/include/mlir/Dialect/Linalg/EDSC/FoldedIntrinsics.h
  mlir/include/mlir/Dialect/Linalg/Transforms/CMakeLists.txt
  mlir/include/mlir/EDSC/Builders.h
  mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
  mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp
  mlir/lib/Dialect/Affine/EDSC/Builders.cpp
  mlir/lib/Dialect/Linalg/EDSC/Builders.cpp
  mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp
  mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
  mlir/lib/EDSC/Builders.cpp
  mlir/test/Dialect/Linalg/matmul-to-vector.mlir
  mlir/test/lib/DeclarativeTransforms/CMakeLists.txt
  mlir/test/lib/DeclarativeTransforms/TestLinalgMatmulToVectorPatterns.td
  mlir/test/lib/Transforms/CMakeLists.txt
  mlir/test/lib/Transforms/TestLinalgMatmulToVector.cpp
  mlir/tools/mlir-opt/mlir-opt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79208.261368.patch
Type: text/x-patch
Size: 25628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200430/49bf8f12/attachment.bin>


More information about the llvm-commits mailing list