[all-commits] [llvm/llvm-project] 76f3c2: [mlir][Pattern] Add better support for using inter...

River Riddle via All-commits all-commits at lists.llvm.org
Tue Mar 23 14:12:39 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76f3c2f3f34a2be05e5970f7413c6929541fd219
      https://github.com/llvm/llvm-project/commit/76f3c2f3f34a2be05e5970f7413c6929541fd219
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-03-23 (Tue, 23 Mar 2021)

  Changed paths:
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M mlir/include/mlir/Conversion/LinalgToStandard/LinalgToStandard.h
    M mlir/include/mlir/Dialect/Linalg/Transforms/CodegenStrategy.h
    M mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
    M mlir/include/mlir/Dialect/Vector/VectorTransforms.h
    M mlir/include/mlir/IR/OpDefinition.h
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/IR/PatternMatch.h
    M mlir/include/mlir/Rewrite/FrozenRewritePatternSet.h
    M mlir/include/mlir/Support/InterfaceSupport.h
    M mlir/include/mlir/Transforms/DialectConversion.h
    M mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
    M mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
    M mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
    M mlir/lib/Dialect/Linalg/Transforms/ElementwiseToLinalg.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
    M mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
    M mlir/lib/Dialect/StandardOps/Transforms/FuncConversions.cpp
    M mlir/lib/IR/PatternMatch.cpp
    M mlir/lib/Rewrite/ByteCode.cpp
    M mlir/lib/Rewrite/FrozenRewritePatternSet.cpp
    M mlir/lib/Rewrite/PatternApplicator.cpp
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp
    M mlir/test/lib/Transforms/TestLinalgTransforms.cpp
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp
    M mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
    M mlir/tools/mlir-tblgen/RewriterGen.cpp
    M mlir/unittests/Rewrite/PatternBenefit.cpp

  Log Message:
  -----------
  [mlir][Pattern] Add better support for using interfaces/traits to match root operations in rewrite patterns

To match an interface or trait, users currently have to use the `MatchAny` tag. This tag can be quite problematic for compile time for things like the canonicalizer, as the `MatchAny` patterns may get applied to  *every* operation. This revision adds better support by bucketing interface/trait patterns based on which registered operations have them registered. This means that moving forward we will only attempt to match these patterns to operations that have this interface registered. Two simplify defining patterns that match traits and interfaces, two new utility classes have been added: OpTraitRewritePattern and OpInterfaceRewritePattern.

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




More information about the All-commits mailing list