[PATCH] D117614: [lld][ELF] Add support for ADRP+ADD optimization for AArch64

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 21 10:29:48 PST 2022


peter.smith added a comment.

Just a couple of small comments. I'll try and take another look next week to see if I can spot anything else.



================
Comment at: lld/ELF/Arch/AArch64.cpp:621
+    return false;
+  // Check the value of the sf bit.
+  if (!(addInstr >> 31))
----------------
I think bit 31 (sf) is already being checked in the mask above 0xf.... = 0x9.... so this check could be removed.


================
Comment at: lld/ELF/Arch/AArch64.cpp:633
+  int64_t val = sym.getVA() - (secAddr + addRel.offset);
+  if (std::abs(val) >= 1024 * 1024)
+    return false;
----------------
This will be worth checking as I think the immediate field is signed so there is a slight asymmetry in positive and negative range.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117614/new/

https://reviews.llvm.org/D117614



More information about the llvm-commits mailing list