[PATCH] D87286: AArch64: make sure jump table entries can reach entire image

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 04:26:16 PDT 2020


t.p.northover added a comment.

Thanks Eli, I'll get back to you with numbers.

I've also discovered (well, Ahmed did) that it's not robust in the face of tail duplication. The first `adr` would steal and emit the label, which might not be in range of the duplicated `adr`. The fix is easy enough (`isNotDuplicable` in TableGen) but I still need to write a nice tempting IR file for the test.



================
Comment at: llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp:856
+  case 2: LdrOpcode = AArch64::LDRHHroX; break;
+  case 4: LdrOpcode = AArch64::LDRSWroX; break;
+  default:
----------------
efriedma wrote:
> efriedma wrote:
> > For 32-bit, we sign-extend?  I guess this is assuming a function can't be larger than 2GB?  (I think you could avoid that assumption by using the compression infrastructure for 32-bit words.)
> On second thought, you're likely to run into other issues well before then, so probably not important.
Yes, I think the function limit is probably well below 2GB already.


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

https://reviews.llvm.org/D87286



More information about the llvm-commits mailing list