-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[PS5] Enable support for DTLTO in the PS5 Clang driver #158041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// REQUIRES: lld | ||
|
||
/// Check DTLTO options are forwarded to the linker. | ||
|
||
/// Check that options are forwarded as expected with --thinlto-distributor=. | ||
// RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \ | ||
// RUN: -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 \ | ||
// RUN: -fthinlto-distributor=d.exe -Werror 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefix=FORWARD | ||
|
||
// FORWARD: prospero-lld | ||
// FORWARD-SAME: "--thinlto-distributor=d.exe" | ||
// FORWARD-SAME: "--thinlto-remote-compiler={{[^"]+}}" | ||
// FORWARD-SAME: "--thinlto-distributor-arg=a1" | ||
// FORWARD-SAME: "--thinlto-distributor-arg=a2" | ||
// FORWARD-SAME: "--thinlto-distributor-arg=a3" | ||
|
||
/// Check that options are not added without --thinlto-distributor= and | ||
/// that a warning is issued for unused -Xthinlto-distributor options. | ||
// RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \ | ||
// RUN: -Xthinlto-distributor=a1 -Xthinlto-distributor=a2,a3 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefix=NODIST --implicit-check-not=distributor \ | ||
// RUN: --implicit-check-not=remote-compiler | ||
|
||
// NODIST: warning: argument unused during compilation: '-Xthinlto-distributor=a1' | ||
// NODIST: warning: argument unused during compilation: '-Xthinlto-distributor=a2,a3' | ||
// NODIST: prospero-lld | ||
|
||
/// Check the expected arguments are forwarded by default with only | ||
/// --thinlto-distributor=. | ||
// RUN: %clang -flto=thin %s -### --target=x86_64-sie-ps5 \ | ||
// RUN: -fthinlto-distributor=d.exe -Werror 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefix=DEFAULT --implicit-check-not=distributor \ | ||
// RUN: --implicit-check-not=remote-compiler | ||
|
||
// DEFAULT: prospero-lld | ||
// DEFAULT-SAME: "--thinlto-distributor=d.exe" | ||
// DEFAULT-SAME: "--thinlto-remote-compiler={{.*}}clang{{[^\"]*}}" | ||
|
||
/// Check that the arguments are forwarded unconditionally even when the | ||
/// compiler is not in LTO mode. | ||
Comment on lines
+40
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will "unused argument" warnings be produced, and should we check for them? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No. Unlike most drivers we consume the arguments even if we are not in LTO mode ( |
||
// RUN: %clang %s -### --target=x86_64-sie-ps5 \ | ||
// RUN: -fthinlto-distributor=d.exe -Werror 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefix=DEFAULT --implicit-check-not=distributor \ | ||
// RUN: --implicit-check-not=remote-compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit,
auto &A
orauto *A
to avoid un-necessary copies? Might not be possible with this type, I can't remember whatgetAllArgValues
returns.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks. I have made the same change for the equivalent code in
addLTOOptions
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change
addLTOOptions
is unrelated to the purpose of this PR, so I would personally prefer it's removal.I would like to consider refactoring what we're doing here to share/align implementation with other drivers. That's probably the point at which
addLTOOptions
could be adjusted.