LLVM::AddressOfOp: properly take into account the address space
authorAlex Zinenko <zinenko@google.com>
Fri, 6 Dec 2019 09:08:40 +0000 (01:08 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Fri, 6 Dec 2019 09:09:13 +0000 (01:09 -0800)
commit58adf99ed1a2656c8aec310e6f78da986eb05570
tree995eeda0c2c7b3e96a3acbd09cb241a440315e00
parent12e57cf6c030a4d1a071ee668d17c5db169d98d6
LLVM::AddressOfOp: properly take into account the address space

The AddressOf operation in the LLVM dialect return a pointer to a global
variable. The latter may be in a non-default address space as indicated by the
"addr_space" attribute. Check that the address space of the pointer returned by
AddressOfOp matches that of the referenced GlobalOp. Update the AddressOfOp
builder to respect this constraint.

PiperOrigin-RevId: 284138860
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/test/Dialect/LLVMIR/global.mlir