[llvm] [BOLT][AArch64] Fixes assertion errors occurred when perf2bolt was executed (PR #83394)
Paschalis Mpeis via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 06:14:27 PDT 2024
================
@@ -0,0 +1,110 @@
+// Test how BOLT handles indirect branch sequence of instructions in
+// AArch64MCPlus builder.
+// This test checks the pattern where there is no shift amount after add
+// instruction. The pattern come from libc, it can be reproduced with
+// a 'static' built binary.
+//
+// adr x6, 0x219fb0 <sigall_set+0x88>
+// add x6, x6, x14, lsl #2
+// ldr w7, [x6]
+// add x6, x6, w7, sxtw => no shift amount
+// br x6
+//
+// It also tests another case where there is no adrp/add pair.
----------------
paschalis-mpeis wrote:
nit: replace
```cpp
// It also tests another case where there is no adrp/add pair.
// The pattern also come from libc, and it only represents in the binary
// if the lld linker is used to create the static binary.
// It doesn't occur with GCC ld linker.
```
with something like:
```cpp
// Pattern 2: nop/adr pair is used in place of adrp/add
```
https://github.com/llvm/llvm-project/pull/83394
More information about the llvm-commits
mailing list