Do not produce Fat binary functions for HIP when no device code is present.
Details
Details
- Reviewers
yaxunl tra - Commits
- rG6d37f326fc69: [HIP-Clang] Fat binary should not be produced for non GPU code
rC357532: [HIP-Clang] Fat binary should not be produced for non GPU code
rL357532: [HIP-Clang] Fat binary should not be produced for non GPU code
rG8129521318ac: [HIP-Clang] Fat binary should not be produced for non GPU code 2
rC357526: [HIP-Clang] Fat binary should not be produced for non GPU code 2
rL357526: [HIP-Clang] Fat binary should not be produced for non GPU code 2
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
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. |
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? |
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. |
Comment Actions
The if condition could use some clang-formatting, but other than that the patch still looks OK to me.