[all-commits] [llvm/llvm-project] 823eda: [mlir][Transforms] Dialect conversion: Extra check...

Matthias Springer via All-commits all-commits at lists.llvm.org
Sat Oct 12 10:57:24 PDT 2024


  Branch: refs/heads/users/matthias-springer/tmp_no_arg_mat
  Home:   https://github.com/llvm/llvm-project
  Commit: 823eda5a65ba4ad27c6b907bbbd81fb16dd38b37
      https://github.com/llvm/llvm-project/commit/823eda5a65ba4ad27c6b907bbbd81fb16dd38b37
  Author: Matthias Springer <mspringer at nvidia.com>
  Date:   2024-10-12 (Sat, 12 Oct 2024)

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

  Log Message:
  -----------
  [mlir][Transforms] Dialect conversion: Extra checks during `replaceOp`

This commit adds extra checks/assertions to the `ConversionPatternRewriterImpl::notifyOpReplaced` to improve its robustness.

Replacing an `unrealized_conversion_cast` op that was created by the driver is forbidden and is now caught early during `replaceOp`. It may work in some cases, but is generally dangerous because the conversion driver keeps track of these ops. (Erasing is them is fine.) This change is also in preparation of a subsequent commit that splits the `ConversionValueMapping` into replacements and materializations (with the goal of simplifying block signature conversions).

`null` replacement values are no longer registered in the `ConversionValueMapping`. This was an oversight in #106760. `null` values in the mapping could result in crashes when using the `ConversionValueMapping` API.


  Commit: d1bbb9161e28451c2dbf3a4df1fd2cb3978b9e28
      https://github.com/llvm/llvm-project/commit/d1bbb9161e28451c2dbf3a4df1fd2cb3978b9e28
  Author: Matthias Springer <mspringer at nvidia.com>
  Date:   2024-10-12 (Sat, 12 Oct 2024)

  Changed paths:
    M mlir/include/mlir/Transforms/DialectConversion.h
    M mlir/lib/Dialect/SCF/Transforms/StructuralTypeConversions.cpp
    M mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
    M mlir/lib/Transforms/Utils/DialectConversion.cpp
    M mlir/test/lib/Dialect/Test/TestPatterns.cpp

  Log Message:
  -----------
  do not build argument materializations anymore


Compare: https://github.com/llvm/llvm-project/compare/e52a5247fa1e...d1bbb9161e28

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