Skip to content

Commit 26f3f24

Browse files
authored
[MLIR][NFC] Declare RuntimeVerifiableOpInterface for memref ops that have an implementation (#145230)
Previously running `-generate-runtime-verification` on an IR containing `memref.reinterpret_cast` would crash because its implementation of the `RuntimeVerifiableOpInterface` was removed in #132547 but its associated entry in `declarePromisedInterface` was never removed. This causes an error when you try and run `-generate-runtime-verification` on an IR containing `memref.reinterpret_cast` that looks like ``` LLVM ERROR: checking for an interface (`mlir::RuntimeVerifiableOpInterface`) that was promised by dialect 'memref' but never implemented. This is generally an indication that the dialect extension implementing the interface was never registered. ``` as reported in #144028. In this PR I also added all the ops that do have implementations of this interface in `mlir/lib/Dialect/MemRef/Transforms/RuntimeOpVerification.cpp` to the `declarePromisedInterface` for consistency. Fixes #144028
1 parent 6a0593b commit 26f3f24

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mlir/lib/Dialect/MemRef/IR/MemRefDialect.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ void mlir::memref::MemRefDialect::initialize() {
5252
declarePromisedInterface<ConvertToLLVMPatternInterface, MemRefDialect>();
5353
declarePromisedInterfaces<bufferization::AllocationOpInterface, AllocOp,
5454
AllocaOp, ReallocOp>();
55-
declarePromisedInterfaces<RuntimeVerifiableOpInterface, CastOp, ExpandShapeOp,
56-
LoadOp, ReinterpretCastOp, StoreOp, SubViewOp>();
55+
declarePromisedInterfaces<RuntimeVerifiableOpInterface, AssumeAlignmentOp,
56+
AtomicRMWOp, CastOp, CopyOp, DimOp, ExpandShapeOp,
57+
GenericAtomicRMWOp, LoadOp, StoreOp, SubViewOp>();
5758
declarePromisedInterfaces<ValueBoundsOpInterface, AllocOp, AllocaOp, CastOp,
5859
DimOp, GetGlobalOp, RankOp, SubViewOp>();
5960
declarePromisedInterface<DestructurableTypeInterface, MemRefType>();

0 commit comments

Comments
 (0)