Page MenuHomePhabricator

[HIP] Add missing options for lto
ClosedPublic

Authored by yaxunl on Jun 24 2020, 3:34 PM.

Details

Summary

Add -mcpu, -mattr, -mllvm, and -save-temps options for lto when necessary.

Diff Detail

Event Timeline

yaxunl created this revision.Jun 24 2020, 3:34 PM
tra added inline comments.Jun 24 2020, 4:10 PM
clang/lib/Driver/ToolChains/HIP.cpp
76

I think StringRef will result in comparison by value. If we happen to have duplicate features, we may end up skipping a comma.
You need to either iterate ofer the pointers to elements of the Features, or use a different method of figuring out if a comma is necessary.
E.g. us a bool set at the end of the body.

yaxunl updated this revision to Diff 273424.Jun 25 2020, 10:08 AM
yaxunl marked an inline comment as done.

Fix issue about -mattr. Also use generic LTO option translation and use -plugin-opt.

yaxunl marked an inline comment as done.Jun 25 2020, 10:09 AM
yaxunl added inline comments.
clang/lib/Driver/ToolChains/HIP.cpp
76

Fixed by using unifyTargetFeatures. This makes sure the features are unique.

tra accepted this revision.Jun 25 2020, 10:19 AM

LGTM.

This revision is now accepted and ready to land.Jun 25 2020, 10:19 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 25 2020, 9:49 PM