Skip to content

Commit 02151ca

Browse files
committedJun 27, 2018
[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 llvm-svn: 335774
1 parent 7c57ae5 commit 02151ca

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
 

‎clang/lib/Driver/ToolChains/HIP.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const char *AMDGCN::Linker::constructLLVMLinkCommand(
8282
FlushDenormalControlBC = "oclc_daz_opt_off.amdgcn.bc";
8383

8484
BCLibs.append({"opencl.amdgcn.bc",
85-
"ockl.amdgcn.bc", "irif.amdgcn.bc", "ocml.amdgcn.bc",
85+
"ocml.amdgcn.bc", "ockl.amdgcn.bc", "irif.amdgcn.bc",
8686
"oclc_finite_only_off.amdgcn.bc",
8787
FlushDenormalControlBC,
8888
"oclc_correctly_rounded_sqrt_on.amdgcn.bc",

‎clang/test/Driver/hip-device-libs.hip

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222

2323
// COM: [[LLVM_LINK:"*.llvm-link"]]
24+
// COM-SAME: {{.*}} "{{.*}}ocml.amdgcn.bc" "{{.*}}ockl.amdgcn.bc" "{{.*}}irif.amdgcn.bc"
2425
// FLUSHD-SAME: {{.*}} "{{.*}}oclc_daz_opt_on.amdgcn.bc"
2526
// NOFLUSHD-SAME: {{.*}} "{{.*}}oclc_daz_opt_off.amdgcn.bc"
2627
// COM-SAME: {{.*}} "-o" "{{.*}}-gfx900-linked-{{.*bc}}"

0 commit comments

Comments
 (0)
Please sign in to comment.