diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td --- a/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td +++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td @@ -57,7 +57,7 @@ // LLVM dialect type. def LLVM_Type : DialectType, + 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 --- a/mlir/test/Dialect/LLVMIR/types.mlir +++ b/mlir/test/Dialect/LLVMIR/types.mlir @@ -178,9 +178,11 @@ // CHECK-LABEL: @ptr_elem_interface // CHECK-COUNT-3: !llvm.ptr +// CHECK: llvm.mlir.undef : !llvm.ptr func @ptr_elem_interface(%arg0: !llvm.ptr) { %0 = llvm.load %arg0 : !llvm.ptr llvm.store %0, %arg0 : !llvm.ptr + llvm.mlir.undef : !llvm.ptr return }