summaryrefslogtreecommitdiffstats
path: root/mlir/test/Target
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2019-08-09 08:59:45 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-08-09 09:00:13 -0700
commit68451df267eda7961fca930ab29c6d38f43b97e2 (patch)
tree6ccdf1a904bfcd43a44e6cd94be08ac273af362e /mlir/test/Target
parentb9ff2dd87edef4a750f2caccbd4923500f3d8405 (diff)
downloadbcm5719-llvm-68451df267eda7961fca930ab29c6d38f43b97e2.tar.gz
bcm5719-llvm-68451df267eda7961fca930ab29c6d38f43b97e2.zip
LLVM dialect and translation: support global strings
Unlike regular constant values, strings must be placed in some memory and referred to through a pointer to that memory. Until now, they were not supported in function-local constant declarations with `llvm.constant`. Introduce support for global strings using `llvm.global`, which would translate them into global arrays in LLVM IR and thus make sure they have some memory allocated for storage. PiperOrigin-RevId: 262569316
Diffstat (limited to 'mlir/test/Target')
-rw-r--r--mlir/test/Target/llvmir.mlir3
1 files changed, 3 insertions, 0 deletions
diff --git a/mlir/test/Target/llvmir.mlir b/mlir/test/Target/llvmir.mlir
index 6f357abc384..6db5cece383 100644
--- a/mlir/test/Target/llvmir.mlir
+++ b/mlir/test/Target/llvmir.mlir
@@ -9,6 +9,9 @@ llvm.global constant @i32_global_const(52: i53) : !llvm.i53
// CHECK: @float_global = internal global float 0.000000e+00
llvm.global @float_global(0.0: f32) : !llvm.float
+// CHECK: @string_const = internal constant [6 x i8] c"foobar"
+llvm.global constant @string_const("foobar") : !llvm<"[6 x i8]">
+
//
// Declarations of the allocation functions to be linked against.
//
OpenPOWER on IntegriCloud