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

Gleb Popov via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 21 03:08:12 PDT 2019

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
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>

More information about the llvm-dev mailing list