[all-commits] [llvm/llvm-project] ec03bb: [mlir] Fix bug in partial dialect conversion

Vladislav Vinogradov via All-commits all-commits at lists.llvm.org
Mon Sep 20 00:38:13 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec03bbe8a74ae593d0ea5d8bf55c337e395873d1
      https://github.com/llvm/llvm-project/commit/ec03bbe8a74ae593d0ea5d8bf55c337e395873d1
  Author: Vladislav Vinogradov <vlad.vinogradov at intel.com>
  Date:   2021-09-20 (Mon, 20 Sep 2021)

  Changed paths:
    M mlir/include/mlir/Conversion/SCFToGPU/SCFToGPU.h
    M mlir/lib/Conversion/SCFToGPU/SCFToGPU.cpp
    M mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp
    M mlir/lib/Dialect/Tensor/Transforms/Bufferize.cpp
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/test/Transforms/test-legalizer-full.mlir
    M mlir/test/Transforms/test-legalizer.mlir
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  [mlir] Fix bug in partial dialect conversion

The discussion on forum:
https://llvm.discourse.group/t/bug-in-partial-dialect-conversion/4115

The `applyPartialConversion` didn't handle the operations, that were
marked as illegal inside dynamic legality callback.
Instead of reporting error, if such operation was not converted to legal set,
the method just added it to `unconvertedSet` in the same way as unknown operations.

This patch fixes that and handle dynamically illegal operations as well.

The patch includes 2 fixes for existing passes:

* `tensor-bufferize` - explicitly mark `std.return` as legal.
* `convert-parallel-loops-to-gpu` - ugly fix with marking visited operations
  to avoid recursive legality checks.

Reviewed By: rriddle

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




More information about the All-commits mailing list