summaryrefslogtreecommitdiffstats
path: root/mlir/test/Target
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2019-10-11 06:13:25 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-10-11 06:32:24 -0700
commit71b82bcbf653fff62bf350991eb23fccd8796531 (patch)
tree5e25bba7e3f962c5bd2a9269c4dc7c511248adf0 /mlir/test/Target
parent47596f534555477ac5cee3b55095af97ca7d7cdb (diff)
downloadbcm5719-llvm-71b82bcbf653fff62bf350991eb23fccd8796531.tar.gz
bcm5719-llvm-71b82bcbf653fff62bf350991eb23fccd8796531.zip
LLVM Dialect: introduce llvm.mlir.null operation
Similarly to `llvm.mlir.undef`, this auxiliary operation creates an SSA value that corresponds to `null` in LLVM IR. This operation is necessary to model sizeof(<...>) behavior when allocating memory. PiperOrigin-RevId: 274158760
Diffstat (limited to 'mlir/test/Target')
-rw-r--r--mlir/test/Target/llvmir.mlir8
1 files changed, 8 insertions, 0 deletions
diff --git a/mlir/test/Target/llvmir.mlir b/mlir/test/Target/llvmir.mlir
index 6c493b100a4..676e497c9a3 100644
--- a/mlir/test/Target/llvmir.mlir
+++ b/mlir/test/Target/llvmir.mlir
@@ -958,3 +958,11 @@ llvm.func @integer_extension_and_truncation(%a : !llvm.i32) {
%2 = llvm.trunc %a : !llvm.i32 to !llvm.i16
llvm.return
}
+
+// Check that the auxiliary `null` operation is converted into a `null` value.
+// CHECK-LABEL: @null
+llvm.func @null() -> !llvm<"i32*"> {
+ %0 = llvm.mlir.null : !llvm<"i32*">
+ // CHECK: ret i32* null
+ llvm.return %0 : !llvm<"i32*">
+}
OpenPOWER on IntegriCloud