[llvm-dev] Using store with operands in non-zero address space

Gleb Popov via llvm-dev
Fri, 21 Jun 2019 10:08:12 -0000

Hello, LLVM devs.

I have the following IR:

  %x = alloca i32, align 4
  %p = alloca i32*, align 8
  store i32* %x, i32** %p, align 8

Now I change module's data layout and run InferAddressSpacePass. This turns
that piece of code into

  %x = alloca i32, align 4, addrspace(1)
  %p = alloca i32*, align 8, addrspace(1)
  store i32 addrspace(1)* %x, i32* addrspace(1)* %p, align 8

But Verifier complains that the module is invalid, saying

error: stored value and pointer type do not match
store i32 addrspace(1)* %x3, i32* addrspace(1)* %p4, align 8

I didn't even manage to write correct IR manually in presence of
addrspace().
Is it a bug, or I'm missing something?

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20190621/d4b752e0/attachment.html>