[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 Jun 11 02:47:17 PDT 2024
================
@@ -0,0 +1,33 @@
+// Test how BOLT handles indirect branch sequence of instructions in
+// AArch64MCPlus builder.
+// This test checks that case when we have no shift amount after add instruction.
+// This pattern comes from libc, so needs to build '-static' binary to
+// reproduce the issue easily.
+//
+// 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 when we use '-fuse-ld=lld' along with '-static'
+// which produces the following sequence of intsructions:
+//
+// nop => nop/adr instead of adrp/add
+// adr x13, 0x215a18 <_nl_value_type_LC_COLLATE+0x50>
+// ldrh w13, [x13, w12, uxtw #1]
+// adr x12, 0x247b30 <__gettextparse+0x5b0>
+// add x13, x12, w13, sxth #2
+// br x13
+
+
+// REQUIRES: system-linux
+// RUN: %clang %s -o %t.exe -Wl,-q -static -fuse-ld=lld --target=aarch64-linux
----------------
paschalis-mpeis wrote:
Re `--target=aarch64-linux`, there was a recent change that makes this obsolete. So if merged like that, the tests would fail.
Can you please:
1. rebase to the latest main, which includes a handful of commits that did that change (details if you want here [comment here](https://github.com/llvm/llvm-project/pull/93584#issuecomment-2147063138)),
2. and then replace that with `--target=aarch64-unknown-linux-gnu` ?
https://github.com/llvm/llvm-project/pull/83394
More information about the llvm-commits
mailing list