[mlir] Align LLVM_Type ODS constraint on type verifiers

Verify only the outer type being LLVM-compatible, the elemental types if
present are already checked by the type verifiers. This makes some LLVM dialect
operations compatible with mixed-dialect types that appear during progressive
lowering.

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D116671
This commit is contained in:
Alex Zinenko committed 2022-01-05 19:00:56 +01:00
1 parent 859ebca744
commit 06cc2f2f12
2 files changed
+3 -1

No files matched your search

@@ -57,7 +57,7 @@ def LLVM_Dialect : Dialect {
// LLVM dialect type.
def LLVM_Type : DialectType<LLVM_Dialect,
CPred<"::mlir::LLVM::isCompatibleType($_self)">,
CPred<"::mlir::LLVM::isCompatibleOuterType($_self)">,
"LLVM dialect-compatible type">;
// Type constraint accepting LLVM token type.
+2
View File
@@ -178,9 +178,11 @@ func @verbose() {
// CHECK-LABEL: @ptr_elem_interface
// CHECK-COUNT-3: !llvm.ptr<!test.smpla>
// CHECK: llvm.mlir.undef : !llvm.ptr<!test.smpla>
func @ptr_elem_interface(%arg0: !llvm.ptr<!test.smpla>) {
%0 = llvm.load %arg0 : !llvm.ptr<!test.smpla>
llvm.store %0, %arg0 : !llvm.ptr<!test.smpla>
llvm.mlir.undef : !llvm.ptr<!test.smpla>
return
}