[all-commits] [llvm/llvm-project] 50f82e: [mlir] Fix missing verification after running an O...

River Riddle via All-commits all-commits at lists.llvm.org
Wed Mar 16 14:54:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 50f82e68470c3efbb8ceae8f8c8d289a079d7031
      https://github.com/llvm/llvm-project/commit/50f82e68470c3efbb8ceae8f8c8d289a079d7031
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2022-03-16 (Wed, 16 Mar 2022)

  Changed paths:
    M mlir/include/mlir/IR/Verifier.h
    M mlir/lib/IR/Verifier.cpp
    M mlir/lib/Pass/Pass.cpp
    A mlir/test/Pass/invalid-parent.mlir
    M mlir/test/lib/Dialect/Test/TestDialect.cpp
    M mlir/test/lib/Dialect/Test/TestOps.td
    M mlir/test/lib/Pass/CMakeLists.txt
    M mlir/test/lib/Pass/TestPassManager.cpp

  Log Message:
  -----------
  [mlir] Fix missing verification after running an OpToOpAdaptorPass

The current decision of when to run the verifier is running on the
assumption that nested passes can't affect the validity of the parent
operation, which isn't true. Parent operations may attach any number
of constraints on nested operations, which may not necessarily be
captured (or shouldn't be captured) at a smaller granularity.

This commit rectifies this by properly running the verifier after an
OpToOpAdaptor pass. To avoid an explosive increase in compile time,
we only run verification on the parent operation itself. To do this, a
flag to mlir::verify is added to avoid recursive verification if it isn't
desired.

Fixes #54288

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




More information about the All-commits mailing list