[PATCH] D103563: [HIP] Fix amdgcn builtin for long type

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 2 15:31:25 PDT 2021


yaxunl created this revision.
yaxunl added reviewers: tra, rjmccall, arsenm, rampitec, b-sumner.
Herald added subscribers: kerbowa, nhaehnle, jvesely.
yaxunl requested review of this revision.
Herald added a subscriber: wdng.

Currently some amdgcn builtins are defined with long int type,
which causes invalid IR on Windows since long int is 32 bit
on Windows whereas these builtins have 64 bit arguments.

As a comparison, generic clang builtins with 64 bit int arguments
or return use long long int to avoid this issue, since long long int
is 64 bit on Linux and Windows.

This patch uses long long int instead of long int to define 64 bit int
arguments or return for amdgcn builtins.


https://reviews.llvm.org/D103563

Files:
  clang/include/clang/Basic/BuiltinsAMDGPU.def
  clang/test/CodeGenCUDA/builtins-amdgcn.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103563.349400.patch
Type: text/x-patch
Size: 6295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210602/61f81199/attachment.bin>


More information about the cfe-commits mailing list