llvm-project/mlir/lib/Transforms/CMakeLists.txt
Matthias Springer 108b08f2a9 [mlir] Add RuntimeVerifiableOpInterface and transform
Static op verification cannot detect cases where an op is valid at compile time but may be invalid at runtime.

An example of such an op is `memref::ExpandShapeOp`.

Invalid at compile time: `memref.expand_shape %m [[0, 1]] : memref<11xf32> into memref<2x5xf32>`

Valid at compile time (because we do not know any better): `memref.expand_shape %m [[0, 1]] : memref<?xf32> into memref<?x5xf32>`. This op may or may not be valid at runtime depending on the runtime shape of `%m`.

Invalid runtime ops such as the one above are hard to debug because they can crash the program execution at a seemingly unrelated position or (even worse) compute an invalid result without crashing.

This revision adds a new op interface `RuntimeVerifiableOpInterface` that can be implemented by ops that provide additional runtime verification. Such runtime verification can be computationally expensive, so it is only generated on an opt-in basis by running `-generate-runtime-verification`. A simple runtime verifier for `memref::ExpandShapeOp` is provided as an example.

Differential Revision: https://reviews.llvm.org/D138576
2022-12-21 10:57:14 +01:00

35 lines
634 B
CMake

add_subdirectory(Utils)
add_mlir_library(MLIRTransforms
Canonicalizer.cpp
ControlFlowSink.cpp
CSE.cpp
GenerateRuntimeVerification.cpp
Inliner.cpp
LocationSnapshot.cpp
LoopInvariantCodeMotion.cpp
OpStats.cpp
SCCP.cpp
StripDebugInfo.cpp
SymbolDCE.cpp
SymbolPrivatize.cpp
TopologicalSort.cpp
ViewOpGraph.cpp
ADDITIONAL_HEADER_DIRS
${MLIR_MAIN_INCLUDE_DIR}/mlir/Transforms
DEPENDS
MLIRTransformsPassIncGen
LINK_LIBS PUBLIC
MLIRAnalysis
MLIRCopyOpInterface
MLIRLoopLikeInterface
MLIRPass
MLIRRuntimeVerifiableOpInterface
MLIRSideEffectInterfaces
MLIRSupport
MLIRTransformUtils
)