Skip to content

Commit 3d5a924

Browse files
[BOLT] link_fdata support for hardcoded offsets in no-LBR
Allow using hardcoded offsets to blocks, eg: ``` // RUN: link_fdata --no-lbr ... // FDATA: 1 foo 0 10 ``` For LBR mode this was already supported. See for example: - tail-duplication-complex.s
1 parent 55a40d3 commit 3d5a924

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bolt/test/AArch64/fdata-nolbr.s

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
# RUN: %clang %cflags -o %t %s
77
# RUN: %clang %s %cflags -Wl,-q -o %t
8-
# RUN: not link_fdata --no-lbr %s %t %t.fdata 2>&1 | FileCheck %s
8+
# RUN: link_fdata --no-lbr %s %t %t.fdata
9+
# RUN: cat %t.fdata | FileCheck %s
910

1011
.text
1112
.globl foo
@@ -14,5 +15,5 @@ foo:
1415
# FDATA: 1 foo 0 10
1516
ret
1617

17-
# Currently does not work on non-lbr mode.
18-
# CHECK: AssertionError: ERROR: wrong format/whitespaces must be escaped
18+
# CHECK: no_lbr
19+
# CHECK-NEXT: 1 foo 0 10

bolt/test/link_fdata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
fdata_match = fdata_pat.match(profile_line)
5959
preagg_match = preagg_pat.match(profile_line)
6060
nolbr_match = nolbr_pat.match(profile_line)
61-
if fdata_match:
61+
if fdata_match and not (nolbr_match and args.no_lbr):
6262
src_dst, execnt, mispred = fdata_match.groups()
6363
# Split by whitespaces not preceded by a backslash (negative lookbehind)
6464
chunks = re.split(r"(?<!\\) +", src_dst)

0 commit comments

Comments
 (0)