[all-commits] [llvm/llvm-project] 27df71: [mlir] Fix dumping invalid ops

Sergei Grechanik via All-commits all-commits at lists.llvm.org
Mon Mar 7 08:45:10 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 27df7158feb2f073c3716b2920ebdee2f5a0eeb6
      https://github.com/llvm/llvm-project/commit/27df7158feb2f073c3716b2920ebdee2f5a0eeb6
  Author: Sergei Grechanik <sergei.grechanik at intel.com>
  Date:   2022-03-07 (Mon, 07 Mar 2022)

  Changed paths:
    M mlir/docs/Diagnostics.md
    M mlir/docs/OpDefinitions.md
    M mlir/include/mlir/IR/OperationSupport.h
    M mlir/include/mlir/IR/Value.h
    M mlir/lib/IR/AsmPrinter.cpp
    M mlir/lib/IR/Diagnostics.cpp
    M mlir/lib/IR/Operation.cpp
    A mlir/test/IR/print-ir-invalid.mlir
    M mlir/test/lib/IR/CMakeLists.txt
    A mlir/test/lib/IR/TestPrintInvalid.cpp
    M mlir/tools/mlir-opt/mlir-opt.cpp

  Log Message:
  -----------
  [mlir] Fix dumping invalid ops

This patch fixes the crash when printing some ops (like affine.for and
scf.for) when they are dumped in invalid state, e.g. during pattern
application. Now the AsmState constructor verifies the operation
first and switches to generic operation printing when the verification
fails. Also operations are now printed in generic form when emitting
diagnostics and the severity level is Error.

Reviewed By: rriddle, mehdi_amini

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




More information about the All-commits mailing list