[PATCH] Fix endianess issue in global variable constant initialization in NVPTX.

Samuel Antao sfantao at us.ibm.com
Fri May 22 13:46:03 PDT 2015


Hi jholewinski,

The constant initialization for globals in NVPTX is generated as an array of bytes. The generation of this byte arrays expects 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. 

I identified this issue while crosscompiling for PTX in power7 machines.

http://reviews.llvm.org/D9946

Files:
  lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  test/CodeGen/NVPTX/globals_init.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9946.26341.patch
Type: text/x-patch
Size: 5182 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150522/f842aa07/attachment.bin>


More information about the llvm-commits mailing list