Page MenuHomePhabricator

[HIP-Clang] Fat binary should not be produced for non GPU code
ClosedPublic

Authored by ashi1 on Apr 2 2019, 10:56 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

ashi1 created this revision.Apr 2 2019, 10:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2019, 10:56 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
yaxunl added a reviewer: tra.Apr 2 2019, 11:04 AM
yaxunl accepted this revision.Apr 2 2019, 12:56 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Apr 2 2019, 12:56 PM
tra added a comment.Apr 2 2019, 1:20 PM

General nit: please use diffs with very large context when you submit patches with Phabricator.
https://llvm.org/docs/Phabricator.html#requesting-a-review-via-the-web-interface

lib/CodeGen/CGCUDANV.cpp
475–476 ↗(On Diff #193328)

I think this would make sense for CUDA, too.

yaxunl added inline comments.Apr 2 2019, 1:32 PM
lib/CodeGen/CGCUDANV.cpp
475–476 ↗(On Diff #193328)

https://github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CGCUDANV.cpp#L482

CUDA generates a dummy register function call for -fgpu-rdc. So probably only do this when RelocatableDeviceCode is false for CUDA?

tra accepted this revision.Apr 2 2019, 1:43 PM
tra added inline comments.
lib/CodeGen/CGCUDANV.cpp
475–476 ↗(On Diff #193328)

Good point. Off the top of my head I can't tell why -fcudardc needs this. Keeping the change HIP-only is fine.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2019, 1:48 PM
ashi1 added a comment.Apr 2 2019, 1:52 PM

Hi Artem, I had just committed the change. IS this change OK or should I revert it?

tra added a comment.Apr 2 2019, 2:35 PM

Hi Artem, I had just committed the change. IS this change OK or should I revert it?

The if condition could use some clang-formatting, but other than that the patch still looks OK to me.

ashi1 added a comment.Apr 3 2019, 7:16 AM

Thank you, I submitted a clang-formatted fix for the if statement.