Skip to content

Commit

Permalink
[HIP] Fix ordering of device-libs linking
Browse files Browse the repository at this point in the history
Summary:
HIP should link the bitcodes with caller functions before callee functions. Also added lit test to check the ordering of the linked bitcodes is matches.

Reviewers: yaxunl, b-sumner

Reviewed By: yaxunl, b-sumner

Subscribers: cfe-commits, yaxunl, b-sumner, scchan

Differential Revision: https://reviews.llvm.org/D48667

llvm-svn: 335774
  • Loading branch information
aaronenyeshi committed Jun 27, 2018
1 parent 7c57ae5 commit 02151ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains/HIP.cpp
Expand Up @@ -82,7 +82,7 @@ const char *AMDGCN::Linker::constructLLVMLinkCommand(
FlushDenormalControlBC = "oclc_daz_opt_off.amdgcn.bc";

BCLibs.append({"opencl.amdgcn.bc",
"ockl.amdgcn.bc", "irif.amdgcn.bc", "ocml.amdgcn.bc",
"ocml.amdgcn.bc", "ockl.amdgcn.bc", "irif.amdgcn.bc",
"oclc_finite_only_off.amdgcn.bc",
FlushDenormalControlBC,
"oclc_correctly_rounded_sqrt_on.amdgcn.bc",
Expand Down
1 change: 1 addition & 0 deletions clang/test/Driver/hip-device-libs.hip
Expand Up @@ -21,6 +21,7 @@


// COM: [[LLVM_LINK:"*.llvm-link"]]
// COM-SAME: {{.*}} "{{.*}}ocml.amdgcn.bc" "{{.*}}ockl.amdgcn.bc" "{{.*}}irif.amdgcn.bc"
// FLUSHD-SAME: {{.*}} "{{.*}}oclc_daz_opt_on.amdgcn.bc"
// NOFLUSHD-SAME: {{.*}} "{{.*}}oclc_daz_opt_off.amdgcn.bc"
// COM-SAME: {{.*}} "-o" "{{.*}}-gfx900-linked-{{.*bc}}"
Expand Down

0 comments on commit 02151ca

Please sign in to comment.