-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[DTLTO][Clang] Add support for Integrated Distributed ThinLTO #147265
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
base: main
Are you sure you want to change the base?
Changes from all commits
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,43 @@ | ||
// REQUIRES: lld | ||
|
||
/// Check DTLTO options are forwarded to the linker. | ||
|
||
// RUN: echo "--target=x86_64-linux-gnu \ | ||
// RUN: -Xthinlto-distributor=distarg1 \ | ||
// RUN: -Xthinlto-distributor=distarg2,distarg3 \ | ||
// RUN: -fuse-ld=lld" > %t.rsp | ||
Comment on lines
+5
to
+8
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. This is OK, but you can achieve the same thing w/ split-file. |
||
|
||
/// Check that options are forwarded as expected with --thinlto-distributor=. | ||
// RUN: %clang -### @%t.rsp -fthinlto-distributor=dist.exe %s 2>&1 | \ | ||
// RUN: FileCheck %s --implicit-check-not=warning | ||
|
||
// CHECK: ld.lld | ||
// CHECK-SAME: "--thinlto-distributor=dist.exe" | ||
// CHECK-SAME: "--thinlto-remote-compiler={{.*}}clang | ||
// CHECK-SAME: "--thinlto-distributor-arg=distarg1" | ||
// CHECK-SAME: "--thinlto-distributor-arg=distarg2" | ||
// CHECK-SAME: "--thinlto-distributor-arg=distarg3" | ||
|
||
|
||
/// Check that options are not added without --thinlto-distributor= and | ||
/// that there is an unused option warning issued for -Xthinlto-distributor= | ||
/// options. We specify -flto here as these options should be unaffected by it. | ||
// RUN: %clang -### @%t.rsp -flto=thin %s 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefixes=NONE,NOMORE --implicit-check-not=warning | ||
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. Confused about the |
||
|
||
// NONE: warning: argument unused during compilation: '-Xthinlto-distributor=distarg1' | ||
// NONE: warning: argument unused during compilation: '-Xthinlto-distributor=distarg2,distarg3' | ||
// NONE: ld.lld | ||
// NOMORE-NOT: distributor | ||
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. Maybe better to put these in |
||
// NOMORE-NOT: remote-compiler | ||
|
||
|
||
/// Check the expected arguments are forwarded by default with only | ||
/// --thinlto-distributor=. | ||
// RUN: %clang --target=x86_64-linux-gnu -fthinlto-distributor=dist.exe \ | ||
// RUN: -fuse-ld=lld -Werror -### %s 2>&1 | \ | ||
// RUN: FileCheck %s --check-prefixes=DEFAULT,NOMORE | ||
|
||
// DEFAULT: ld.lld | ||
// DEFAULT-SAME: "--thinlto-distributor=dist.exe" | ||
// DEFAULT-SAME: "--thinlto-remote-compiler={{.*}}clang |
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.
Why not be consistent with the other LTO options though, which are added in addLTOOptions? The same argument could be made for those (and maybe they should be sent unconditionally, but that seems like a separate discussion).