From 4c9a739c5ea72eb37a7c998e25d9a0a096042c73 Mon Sep 17 00:00:00 2001 From: Alexandros Lamprineas Date: Thu, 2 Apr 2026 10:16:41 +0100 Subject: [PATCH] [BOLT][AArch64] Strip uneeded labels from FEAT_CMPBR tests. (#189931) Eliminates the temporary labels so that BOLT does not recognize them as secondary entry points. --- bolt/test/AArch64/compare-and-branch-inversion.S | 9 +-------- bolt/test/AArch64/compare-and-branch-reorder-blocks.S | 9 +++------ bolt/test/AArch64/compare-and-branch-split-functions.S | 3 +++ bolt/test/AArch64/compare-and-branch-unsupported.S | 3 +++ 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/bolt/test/AArch64/compare-and-branch-inversion.S b/bolt/test/AArch64/compare-and-branch-inversion.S index 479775a2bbd6..28167416c31c 100644 --- a/bolt/test/AArch64/compare-and-branch-inversion.S +++ b/bolt/test/AArch64/compare-and-branch-inversion.S @@ -7,6 +7,7 @@ # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: llvm-bolt -v=1 %t -o %t.bolt --data %t.fdata --reorder-blocks=ext-tsp --compact-code-model \ # RUN: | FileCheck %s --check-prefix=BOLT-INFO # RUN: llvm-objdump -d %t.bolt | FileCheck %s @@ -30,10 +31,8 @@ immediate_increment: # CHECK: : # CHECK-NEXT: {{.*}} cblt x0, #0x1, 0x[[ADDR0:[0-9a-f]+]] <{{.*}}> -# CHECK: <.exit0>: # CHECK-NEXT: {{.*}} mov x0, #0x2 // =2 # CHECK-NEXT: {{.*}} ret -# CHECK: <.cold0>: # CHECK-NEXT: [[ADDR0]]: {{.*}} mov x0, #0x1 // =1 # CHECK-NEXT: {{.*}} ret @@ -54,10 +53,8 @@ immediate_decrement: # CHECK: : # CHECK-NEXT: {{.*}} cbhi x0, #0x0, 0x[[ADDR1:[0-9a-f]+]] <{{.*}}> -# CHECK: <.exit1>: # CHECK-NEXT: {{.*}} mov x0, #0x2 // =2 # CHECK-NEXT: {{.*}} ret -# CHECK: <.cold1>: # CHECK-NEXT: [[ADDR1]]: {{.*}} mov x0, #0x1 // =1 # CHECK-NEXT: {{.*}} ret @@ -78,10 +75,8 @@ register_swap: # CHECK: : # CHECK-NEXT: {{.*}} cbgt x1, x0, 0x[[ADDR2:[0-9a-f]+]] <{{.*}}> -# CHECK: <.exit2>: # CHECK-NEXT: {{.*}} mov x0, #0x2 // =2 # CHECK-NEXT: {{.*}} ret -# CHECK: <.cold2>: # CHECK-NEXT: [[ADDR2]]: {{.*}} mov x0, #0x1 // =1 # CHECK-NEXT: {{.*}} ret @@ -105,10 +100,8 @@ irreversible: # CHECK: : # CHECK-NEXT: {{.*}} cbgt x0, #0x3f, 0x[[ADDR3:[0-9a-f]+]] <{{.*}}> # CHECK-NEXT: {{.*}} b 0x[[ADDR4:[0-9a-f]+]] <{{.*}}> -# CHECK: <.exit3>: # CHECK-NEXT: [[ADDR3]]: {{.*}} mov x0, #0x2 // =2 # CHECK-NEXT: {{.*}} ret -# CHECK: <.cold3>: # CHECK-NEXT: [[ADDR4]]: {{.*}} mov x0, #0x1 // =1 # CHECK-NEXT: {{.*}} ret diff --git a/bolt/test/AArch64/compare-and-branch-reorder-blocks.S b/bolt/test/AArch64/compare-and-branch-reorder-blocks.S index a7c2bd122b3c..a684e7148db8 100644 --- a/bolt/test/AArch64/compare-and-branch-reorder-blocks.S +++ b/bolt/test/AArch64/compare-and-branch-reorder-blocks.S @@ -6,16 +6,19 @@ # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=0 -DIMM=0 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: llvm-bolt %t -o %t.bolt --data %t.fdata --reorder-blocks=ext-tsp --compact-code-model # RUN: llvm-objdump -d %t.bolt | FileCheck %s # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=256 -DIMM=0 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: llvm-bolt %t -o %t.bolt --data %t.fdata --reorder-blocks=ext-tsp --compact-code-model --keep-nops # RUN: llvm-objdump -d %t.bolt | FileCheck %s --check-prefix=BEYOND-1KB # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=256 -DIMM=63 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: llvm-bolt %t -o %t.bolt --data %t.fdata --reorder-blocks=ext-tsp --compact-code-model --keep-nops # RUN: llvm-objdump -d %t.bolt | FileCheck %s --check-prefix=BEYOND-1KB-IRREVERSIBLE @@ -47,10 +50,8 @@ reorder_blocks: # CHECK: : # CHECK-NEXT: {{.*}} cbgt x0, #0x0, 0x[[ADDR:[0-9a-f]+]] <{{.*}}> -# CHECK: <.hot_exit>: # CHECK-NEXT: {{.*}} mov x0, #0x2 // =2 # CHECK-NEXT: {{.*}} ret -# CHECK: <.cold_exit>: # CHECK-NEXT: [[ADDR]]: {{.*}} mov x0, #0x1 // =1 # CHECK-NEXT: {{.*}} ret @@ -59,11 +60,9 @@ reorder_blocks: # BEYOND-1KB: : # BEYOND-1KB-NEXT: {{.*}} cblt x0, #0x1, 0x[[ADDR0:[0-9a-f]+]] <{{.*}}> # BEYOND-1KB-NEXT: {{.*}} b 0x[[ADDR1:[0-9a-f]+]] <{{.*}}> -# BEYOND-1KB: <.hot_exit>: # BEYOND-1KB-NEXT: [[ADDR0]]: {{.*}} nop # BEYOND-1KB: {{.*}} mov x0, #0x2 // =2 # BEYOND-1KB-NEXT: {{.*}} ret -# BEYOND-1KB: <.cold_exit>: # BEYOND-1KB-NEXT: [[ADDR1]]: {{.*}} mov x0, #0x1 // =1 # BEYOND-1KB-NEXT: {{.*}} ret @@ -73,10 +72,8 @@ reorder_blocks: # BEYOND-1KB-IRREVERSIBLE-NEXT: {{.*}} cbgt x0, #0x3f, 0x[[ADDR0:[0-9a-f]+]] <{{.*}}> # BEYOND-1KB-IRREVERSIBLE-NEXT: {{.*}} b 0x[[ADDR1:[0-9a-f]+]] <{{.*}}> # BEYOND-1KB-IRREVERSIBLE-NEXT: [[ADDR0]]: {{.*}} b 0x[[ADDR2:[0-9a-f]+]] <{{.*}}> -# BEYOND-1KB-IRREVERSIBLE: <.hot_exit>: # BEYOND-1KB-IRREVERSIBLE-NEXT: [[ADDR1]]: {{.*}} nop # BEYOND-1KB-IRREVERSIBLE: {{.*}} mov x0, #0x2 // =2 # BEYOND-1KB-IRREVERSIBLE-NEXT: {{.*}} ret -# BEYOND-1KB-IRREVERSIBLE: <.cold_exit>: # BEYOND-1KB-IRREVERSIBLE-NEXT: [[ADDR2]]: {{.*}} mov x0, #0x1 // =1 # BEYOND-1KB-IRREVERSIBLE-NEXT: {{.*}} ret diff --git a/bolt/test/AArch64/compare-and-branch-split-functions.S b/bolt/test/AArch64/compare-and-branch-split-functions.S index b9309a1ec69a..f111f15bd4bf 100644 --- a/bolt/test/AArch64/compare-and-branch-split-functions.S +++ b/bolt/test/AArch64/compare-and-branch-split-functions.S @@ -6,16 +6,19 @@ # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=0 -DRESERVE_SPACE=0 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: llvm-bolt %t -o %t.bolt --data %t.fdata -split-functions --compact-code-model # RUN: llvm-objdump -d %t.bolt | FileCheck %s # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=256 -DRESERVE_SPACE=0 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: llvm-bolt %t -o %t.bolt --data %t.fdata -split-functions --compact-code-model --keep-nops # RUN: llvm-objdump -d %t.bolt | FileCheck %s # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=0 -DRESERVE_SPACE=1 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: not llvm-bolt %t -o %t.bolt --data %t.fdata -split-functions --compact-code-model 2>&1 \ # RUN: | FileCheck %s --check-prefix=BEYOND-128MB diff --git a/bolt/test/AArch64/compare-and-branch-unsupported.S b/bolt/test/AArch64/compare-and-branch-unsupported.S index a09c4fd32506..b0384cee0618 100644 --- a/bolt/test/AArch64/compare-and-branch-unsupported.S +++ b/bolt/test/AArch64/compare-and-branch-unsupported.S @@ -5,16 +5,19 @@ # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=0 -DRESERVE_SPACE=0 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: not llvm-bolt %t -o %t.bolt --data %t.fdata -split-functions 2>&1 \ # RUN: | FileCheck %s # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=256 -DRESERVE_SPACE=0 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: not llvm-bolt %t -o %t.bolt --data %t.fdata -split-functions --keep-nops 2>&1 \ # RUN: | FileCheck %s # RUN: %clang %cflags -march=armv9-a+cmpbr -Wl,-q %s -o %t -DNUM_NOPS=0 -DRESERVE_SPACE=1 # RUN: link_fdata --no-lbr %s %t %t.fdata +# RUN: llvm-strip --strip-unneeded %t # RUN: not llvm-bolt %t -o %t.bolt --data %t.fdata -split-functions 2>&1 \ # RUN: | FileCheck %s