The constant initialization for globals in NVPTX is generated as an
authorSamuel Antao <sfantao@us.ibm.com>
Tue, 9 Jun 2015 16:29:34 +0000 (16:29 +0000)
committerSamuel Antao <sfantao@us.ibm.com>
Tue, 9 Jun 2015 16:29:34 +0000 (16:29 +0000)
commitcd50135a29b80e6fa5dbf8de49845e2edda07bef
treea2db6ff1f36b68312ac2b0d7ee86f65f32a11021
parentaf79f3dbd3147a945fe5497a64f5f5a648b5c7d1
The constant initialization for globals in NVPTX is generated as an
array of bytes. The generation of this byte arrays was expecting
the host to be little endian, which prevents big endian hosts to be
used in the generation of the PTX code. This patch fixes the
problem by changing the way the bytes are extracted so that it
works for either little and big endian.

llvm-svn: 239412
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/test/CodeGen/NVPTX/globals_init.ll [new file with mode: 0644]