This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Fix device lib selection
ClosedPublic

Authored by yaxunl on Apr 30 2021, 12:03 PM.

Details

Summary

Choose optimized device lib bitcode by fp options
for performance.

Diff Detail

Event Timeline

yaxunl created this revision.Apr 30 2021, 12:03 PM
yaxunl requested review of this revision.Apr 30 2021, 12:03 PM
tra accepted this revision.Apr 30 2021, 12:35 PM
This revision is now accepted and ready to land.Apr 30 2021, 12:35 PM
MaskRay added inline comments.
clang/test/Driver/hip-device-libs.hip
117

You can pack more arguments on one line.

Fewer line wraps actually make a test more readable IMO.

157

You can use the -SAME: {{^}} pattern in linux-cross.cpp

yaxunl marked 2 inline comments as done.Apr 30 2021, 1:30 PM
yaxunl added inline comments.
clang/test/Driver/hip-device-libs.hip
117

Will do.

157

What does {{^}} do? Thanks.

MaskRay added inline comments.Apr 30 2021, 4:00 PM
clang/test/Driver/hip-device-libs.hip
157

// CHECK-SAME: {{^}} "-mlink... ensures that the unmatched part after the previous pattern must start with "-mlink...

In case there is a new option, the pattern can catch such a case.

yaxunl marked 2 inline comments as done.Apr 30 2021, 4:09 PM
yaxunl added inline comments.
clang/test/Driver/hip-device-libs.hip
157

I see. Actually we do not need to make sure that. We only need to make sure these items exist in the same line. We do not even care about their orders.

yaxunl updated this revision to Diff 342156.May 1 2021, 9:05 AM
yaxunl marked an inline comment as done.

revise test by Fangrui's comment. Also fix test failure

MaskRay accepted this revision.May 1 2021, 9:56 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMay 1 2021, 6:41 PM