[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:18 PDT 2024


================
@@ -752,6 +765,20 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
       return true;
     }
 
+    if (DefJTBaseAdd->getOpcode() == AArch64::ADR) {
+      // TODO: handle that case when we do not have adrp/add pair.
+      // It also occurs when the binary is static.
+      //  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
+      LLVM_DEBUG(
----------------
paschalis-mpeis wrote:

Maybe we could use just `err()` for a BOLT-WARNING? (same applies to previous pattern. see comment on tests).

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


More information about the llvm-commits mailing list