LLVM dialect: introduce llvm.addressof to access globals
authorAlex Zinenko <zinenko@google.com>
Mon, 12 Aug 2019 13:10:29 +0000 (06:10 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 12 Aug 2019 13:10:54 +0000 (06:10 -0700)
commit2dd38b09c111ff6963c5c592c76e9b771a8f691f
tree5fa1787c102a6901b7df5d550af3ab54c2c7fb62
parent252ada493276eace3e23802fb70ff3c7be53837d
LLVM dialect: introduce llvm.addressof to access globals

This instruction is a local counterpart of llvm.global that takes a symbol
reference to a global and produces an SSA value containing the pointer to it.
Used in combination, these two operations allow one to use globals with other
operations expecting SSA values.  At a cost of IR indirection, we make sure the
functions don't implicitly capture the surrounding SSA values and remain
suitable for parallel processing.

PiperOrigin-RevId: 262908622
mlir/g3doc/Dialects/LLVM.md
mlir/include/mlir/LLVMIR/LLVMOps.td
mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
mlir/lib/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/LLVMIR/global.mlir
mlir/test/Target/llvmir.mlir