-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][CodeGen] Omit pre-opt link when post-opt is link requested (#…
…85672) Currently, when the -relink-builtin-bitcodes-postop option is used we link builtin bitcodes twice: once before optimization, and again after optimization. With this change, we omit the pre-opt linking when the option is set, and we rename the option to the following: -Xclang -mlink-builtin-bitcodes-postopt (-Xclang -mno-link-builtin-bitcodes-postopt) The goal of this change is to reduce compile time. We do lose the theoretical benefits of pre-opt linking, but in practice these are small than the overhead of linking twice. However we may be able to address this in a future patch by adjusting the position of the builtin-bitcode linking pass. Compilations not setting the option are unaffected
- Loading branch information
Showing
7 changed files
with
43 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// REQUIRES: amdgpu-registered-target | ||
|
||
// Test that -mlink-bitcode-postopt correctly enables LinkInModulesPass | ||
|
||
// RUN: %clang_cc1 -triple amdgcn-- -emit-llvm-bc -o /dev/null \ | ||
// RUN: -mllvm -print-pipeline-passes \ | ||
// RUN: %s 2>&1 | FileCheck --check-prefixes=DEFAULT %s | ||
|
||
// DEFAULT-NOT: LinkInModulesPass | ||
|
||
// RUN: %clang_cc1 -triple amdgcn-- -emit-llvm-bc -o /dev/null \ | ||
// RUN: -mllvm -print-pipeline-passes \ | ||
// RUN: -mlink-builtin-bitcode-postopt \ | ||
// RUN: %s 2>&1 | FileCheck --check-prefixes=OPTION-POSITIVE %s | ||
|
||
// OPTION-POSITIVE: LinkInModulesPass | ||
|
||
// RUN: %clang_cc1 -triple amdgcn-- -emit-llvm-bc -o /dev/null \ | ||
// RUN: -mllvm -print-pipeline-passes \ | ||
// RUN: -mno-link-builtin-bitcode-postopt \ | ||
// RUN: %s 2>&1 | FileCheck --check-prefixes=OPTION-NEGATIVE %s | ||
|
||
// OPTION-NEGATIVE-NOT: LinkInModulesPass | ||
|
||
// RUN: %clang_cc1 -triple amdgcn-- -emit-llvm-bc -o /dev/null \ | ||
// RUN: -mllvm -print-pipeline-passes \ | ||
// RUN: -mlink-builtin-bitcode-postopt \ | ||
// RUN: -mno-link-builtin-bitcode-postopt \ | ||
// RUN: %s 2>&1 | FileCheck --check-prefixes=OPTION-POSITIVE-NEGATIVE %s | ||
|
||
// OPTION-POSITIVE-NEGATIVE-NOT: LinkInModulesPass |