[Mlir-commits] [mlir] 06cc2f2 - [mlir] Align LLVM_Type ODS constraint on type verifiers
Alex Zinenko
llvmlistbot at llvm.org
Wed Jan 5 10:01:02 PST 2022
Author: Alex Zinenko
Date: 2022-01-05T19:00:56+01:00
New Revision: 06cc2f2f122ab2ce6c2ffb5cd6f87f0334919ca3
URL: https://github.com/llvm/llvm-project/commit/06cc2f2f122ab2ce6c2ffb5cd6f87f0334919ca3
DIFF: https://github.com/llvm/llvm-project/commit/06cc2f2f122ab2ce6c2ffb5cd6f87f0334919ca3.diff
LOG: [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
Added:
Modified:
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/test/Dialect/LLVMIR/types.mlir
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
index f4f73a8ddb14d..386bd76bf1d59 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
@@ -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.
diff --git a/mlir/test/Dialect/LLVMIR/types.mlir b/mlir/test/Dialect/LLVMIR/types.mlir
index 9a53f56ce70e8..6e1a571d0ca1e 100644
--- a/mlir/test/Dialect/LLVMIR/types.mlir
+++ b/mlir/test/Dialect/LLVMIR/types.mlir
@@ -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
}
More information about the Mlir-commits
mailing list