-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Clang] Make --lto-partitions
only default for HIP
#133164
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 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 |
---|---|---|
|
@@ -21,7 +21,7 @@ | |
// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx90a:xnack+:sramecc- -nogpulib \ | ||
// RUN: -L. -flto -fconvergent-functions %s 2>&1 | FileCheck -check-prefix=LTO %s | ||
// LTO: clang{{.*}} "-flto=full"{{.*}}"-fconvergent-functions" | ||
// LTO: ld.lld{{.*}}"-L."{{.*}}"-plugin-opt=mcpu=gfx90a"{{.*}}"--lto-partitions={{[0-9]+}}"{{.*}}"-plugin-opt=-mattr=-sramecc,+xnack" | ||
// LTO: ld.lld{{.*}}"-L."{{.*}}"-plugin-opt=mcpu=gfx90a"{{.*}}"-plugin-opt=-mattr=-sramecc,+xnack" | ||
|
||
// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx90a:xnack+:sramecc- -nogpulib \ | ||
// RUN: -L. -fconvergent-functions %s 2>&1 | FileCheck -check-prefix=MCPU %s | ||
|
@@ -38,17 +38,3 @@ | |
// RUN: %clang -target amdgcn-amd-amdhsa -march=gfx90a -stdlib -startfiles \ | ||
// RUN: -nogpulib -nogpuinc -### %s 2>&1 | FileCheck -check-prefix=STARTUP %s | ||
// STARTUP: ld.lld{{.*}}"-lc" "-lm" "{{.*}}crt1.o" | ||
|
||
// Check --flto-partitions | ||
|
||
// RUN: %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx90a -nogpulib \ | ||
// RUN: -L. -flto --flto-partitions=42 %s 2>&1 | FileCheck -check-prefix=LTO_PARTS %s | ||
// LTO_PARTS: ld.lld{{.*}}"-L."{{.*}}"-plugin-opt=mcpu=gfx90a"{{.*}}"--lto-partitions=42" | ||
|
||
// RUN: not %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx90a -nogpulib \ | ||
// RUN: -L. -flto --flto-partitions=a %s 2>&1 | FileCheck -check-prefix=LTO_PARTS_INV0 %s | ||
// LTO_PARTS_INV0: clang: error: invalid integral value 'a' in '--flto-partitions=a' | ||
|
||
// RUN: not %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx90a -nogpulib \ | ||
// RUN: -L. -flto --flto-partitions=0 %s 2>&1 | FileCheck -check-prefix=LTO_PARTS_INV1 %s | ||
// LTO_PARTS_INV1: clang: error: invalid integral value '0' in '--flto-partitions=0' | ||
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. can you move these checks to a hip file then? |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,8 @@ function(add_startup_object name) | |
set_target_properties(${fq_target_name}.exe PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY ${LIBC_LIBRARY_DIR} | ||
RUNTIME_OUTPUT_NAME ${name}.o) | ||
# FIXME: A bug in the AMDGPU LTO pass is incorrectly removing the kernels. | ||
if(LIBC_TARGET_ARCHITECTURE_IS_NVPTX) | ||
target_link_options(${fq_target_name}.exe PRIVATE | ||
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm") | ||
else() | ||
target_link_options(${fq_target_name}.exe PRIVATE | ||
"-r" "-nostdlib" "-Wl,--lto-emit-llvm") | ||
endif() | ||
target_link_options(${fq_target_name}.exe PRIVATE | ||
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. unrelated? 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. Related, this works around what this patch disables. |
||
"-r" "-nostdlib" "-flto" "-Wl,--lto-emit-llvm") | ||
endif() | ||
endfunction() | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.