[llvm] [BOLT][AArch64] Fixes assertion errors occurred when perf2bolt was executed (PR #83394)

Vladislav Khmelevsky via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 4 02:46:29 PDT 2024


yota9 wrote:

@kaadam Hi, could you please reformat test to smth like:

```
  .section .text
  .align 4
  .globl _start
  .type  _start, %function
_start:
  bl test1
  bl test2

 .globl test1
 .type test2, %function
test1:
  adr     x3, jump_table
  ldrh    w3, [x3, x1, lsl #1]
  adr     x1, .test1_0
  add     x3, x1, w3, sxth #2
  br      x3

test1_0:
  ret
test1_1:
  ret

 .globl test2
 .type test2, %function
test2:
  nop
  adr     x3, jump_table
  ldrh    w3, [x3, x1, lsl #1]
  adr     x1, .case0
  add     x3, x1, w3, sxth #2

  .section .rodata,"a", at progbits
jump_table:
  .hword  (.case0-.case0)>>2
  .hword  (.case1-.case0)>>2

test2_0:
  ret
rest2_1:
  ret
test2_2:
  ret

datatable:
  .word test2_0-datatable
  .word test2_1-datatable
  .word test2_2-datatable
```

So they won't be connected, this way it would be much more readable

https://github.com/llvm/llvm-project/pull/83394


More information about the llvm-commits mailing list