[MLIR] Support `global_memref` and `get_global_memref` in standard -> LLVM conversion.
authorRahul Joshi <jurahul@google.com>
Mon, 9 Nov 2020 17:01:39 +0000 (09:01 -0800)
committerRahul Joshi <jurahul@google.com>
Mon, 9 Nov 2020 18:54:21 +0000 (10:54 -0800)
commita97e357e8ed46e578cb34ec795ba4f9fdefee189
tree459c4d289572cd806e2092a5a52737bf05b9168f
parenta41ea782c8e1273af4a39a647e41d6f0f42c3411
[MLIR] Support `global_memref` and `get_global_memref` in standard -> LLVM conversion.

- Convert `global_memref` to LLVM::GlobalOp.
- Convert `get_global_memref` to a memref descriptor with a pointer to the first element
  of the global stashed in it.
- Extend unit test and a mlir-cpu-runner test to validate the generated LLVM IR.

Differential Revision: https://reviews.llvm.org/D90803
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
mlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
mlir/test/mlir-cpu-runner/global_memref.mlir [new file with mode: 0644]