Skip to content

[InstrProf][lld] Extend test to confirm order_file takes precedense over BP #118889

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

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

ellishg
Copy link
Contributor

@ellishg ellishg commented Dec 5, 2024

When both -order_file and --irpgo-profile-sort= (soon to be -bp-startup-sort=function in #118594) are used, we want to confirm that symbols in the orderfile take precedence.

@llvmbot
Copy link
Member

llvmbot commented Dec 5, 2024

@llvm/pr-subscribers-lld

@llvm/pr-subscribers-lld-macho

Author: Ellis Hoag (ellishg)

Changes

When both -order_file and --irpgo-profile-sort= (soon to be -bp-startup-sort=function in #118594) are used, we want to confirm that symbols in the orderfile take precedence.


Full diff: https://github.com/llvm/llvm-project/pull/118889.diff

1 Files Affected:

  • (modified) lld/test/MachO/bp-section-orderer.s (+21-4)
diff --git a/lld/test/MachO/bp-section-orderer.s b/lld/test/MachO/bp-section-orderer.s
index 407787025150d2..f220a08aff0f80 100644
--- a/lld/test/MachO/bp-section-orderer.s
+++ b/lld/test/MachO/bp-section-orderer.s
@@ -9,8 +9,11 @@
 
 # STARTUP: Ordered 3 sections using balanced partitioning
 
-# RUN: %lld -arch arm64 -lSystem -e _main -o - %t/a.o --irpgo-profile-sort=%t/a.profdata -order_file %t/a.orderfile | llvm-nm --numeric-sort --format=just-symbols - | FileCheck %s --check-prefix=ORDERFILE
+# Check that orderfiles take precedence over BP
+# RUN: %lld -arch arm64 -lSystem -e _main -o - %t/a.o -order_file %t/a.orderfile --irpgo-profile-sort=%t/a.profdata  | llvm-nm --numeric-sort --format=just-symbols - | FileCheck %s --check-prefix=ORDERFILE
+# RUN: %lld -arch arm64 -lSystem -e _main -o - %t/a.o -order_file %t/a.orderfile --compression-sort=both | llvm-nm --numeric-sort --format=just-symbols - | FileCheck %s --check-prefix=ORDERFILE
 
+# Functions
 # ORDERFILE: A
 # ORDERFILE: F
 # ORDERFILE: E
@@ -18,10 +21,15 @@
 # ORDERFILE-DAG: _main
 # ORDERFILE-DAG: _B
 # ORDERFILE-DAG: l_C
+
+# Data
+# ORDERFILE: s3
+# ORDERFILE: r3
+# ORDERFILE: r2
 # ORDERFILE-DAG: s1
 # ORDERFILE-DAG: s2
 # ORDERFILE-DAG: r1
-# ORDERFILE-DAG: r2
+# ORDERFILE-DAG: r4
 
 # RUN: %lld -arch arm64 -lSystem -e _main -o %t/a.out %t/a.o --verbose-bp-section-orderer --compression-sort=function 2>&1 | FileCheck %s --check-prefix=COMPRESSION-FUNC
 # RUN: %lld -arch arm64 -lSystem -e _main -o %t/a.out %t/a.o --verbose-bp-section-orderer --compression-sort=data 2>&1 | FileCheck %s --check-prefix=COMPRESSION-DATA
@@ -29,8 +37,8 @@
 # RUN: %lld -arch arm64 -lSystem -e _main -o %t/a.out %t/a.o --verbose-bp-section-orderer --compression-sort=both --irpgo-profile-sort=%t/a.profdata 2>&1 | FileCheck %s --check-prefix=COMPRESSION-BOTH
 
 # COMPRESSION-FUNC: Ordered 7 sections using balanced partitioning
-# COMPRESSION-DATA: Ordered 4 sections using balanced partitioning
-# COMPRESSION-BOTH: Ordered 11 sections using balanced partitioning
+# COMPRESSION-DATA: Ordered 7 sections using balanced partitioning
+# COMPRESSION-BOTH: Ordered 14 sections using balanced partitioning
 
 #--- a.s
 .text
@@ -66,10 +74,16 @@ s1:
   .ascii "hello world"
 s2:
   .ascii "i am a string"
+s3:
+  .ascii "this is s3"
 r1:
   .quad s1
 r2:
   .quad r1
+r3:
+  .quad r2
+r4:
+  .quad s2
 
 .subsections_via_symbols
 
@@ -121,3 +135,6 @@ A
 F
 E
 D
+s3
+r3
+r2

@ellishg ellishg requested a review from mysterymath December 5, 2024 22:21
@ellishg ellishg merged commit e33b00a into llvm:main Dec 6, 2024
11 checks passed
@ellishg ellishg deleted the bp-orderfile-test branch December 6, 2024 00:27
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 6, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-aarch64-darwin running on doug-worker-4 while building lld at step 2 "checkout".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/190/builds/10803

Here is the relevant piece of the build log for the reference
Step 2 (checkout) failure: update (failure)
git version 2.39.3 (Apple Git-146)
error: cannot open '.git/FETCH_HEAD': No space left on device
error: cannot open '.git/FETCH_HEAD': No space left on device

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 6, 2024

LLVM Buildbot has detected a new failure on builder arc-builder running on arc-worker while building lld at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/8722

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: 1200 seconds without output running [b'ninja', b'check-all'], attempting to kill
0.411 [59/18/1] Linking CXX executable tools/clang/unittests/InstallAPI/InstallAPITests
0.871 [58/18/2] Linking CXX executable tools/clang/unittests/Basic/BasicTests
1.307 [57/18/3] Linking CXX executable tools/clang/unittests/Format/FormatTests
5.385 [56/18/4] Linking CXX executable tools/clang/unittests/Lex/LexTests
5.780 [55/18/5] Linking CXX executable tools/clang/unittests/libclang/libclangTests
73.895 [54/18/6] Linking CXX executable tools/clang/unittests/Analysis/ClangAnalysisTests
77.614 [53/18/7] Linking CXX executable tools/clang/unittests/CrossTU/CrossTUTests
79.388 [52/18/8] Linking CXX executable tools/clang/unittests/libclang/CrashTests/libclangCrashTests
79.671 [51/18/9] Linking CXX executable tools/clang/unittests/Tooling/Syntax/SyntaxTests
89.907 [50/18/10] Linking CXX executable tools/clang/unittests/ASTMatchers/Dynamic/DynamicASTMatchersTests
command timed out: 1200 seconds without output running [b'ninja', b'check-all'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=1290.706795

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants