[PATCH] D46472: [HIP] Support offloading by linkscript

2018-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 145480. yaxunl marked 2 inline comments as done. yaxunl added a comment. Rename variables used for CUDA only. https://reviews.llvm.org/D46472 Files: include/clang/Driver/Options.td lib/CodeGen/CGCUDANV.cpp lib/Driver/ToolChains/CommonArgs.cpp

[PATCH] D46472: [HIP] Support offloading by linkscript

2018-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:317 + if (GpuBinaryFileName.empty() && !IsHIP) return nullptr; rjmccall wrote: > Is this filename string only used for CUDA? If so, please rename

[PATCH] D46472: [HIP] Support offloading by linkscript

2018-05-04 Thread John McCall via Phabricator via cfe-commits
rjmccall added a comment. The IRGen aspects of this seem reasonable, modulo a comment change. I don't feel qualified to judge the driver change. Comment at: lib/CodeGen/CGCUDANV.cpp:317 + if (GpuBinaryFileName.empty() && !IsHIP) return nullptr; Is

[PATCH] D46472: [HIP] Support offloading by linkscript

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. To support linking device code in different source files, it is necessary to embed fat binary at host linking stage. This patch emits an external symbol for fat binary in host codegen, then embed the fat binary by lld through a