[HIP] Fix ordering of device-libs linking

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335774 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Aaron Enye Shi 2018-06-27 19:51:42 +00:00
parent 53d8fcb5c2
commit 81c2075695
2 changed files with 2 additions and 1 deletions

View File

@ -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",

View File

@ -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}}"