[PATCH] D32564: AArch64: compress jump tables to minimum size needed to reach destinations
Tim Northover via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 24 07:21:19 PDT 2018
t.p.northover marked an inline comment as done.
t.p.northover added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64CompressJumpTables.cpp:115
+ auto AFI = MF->getInfo<AArch64FunctionInfo>();
+ if (isInt<8>(MaxOffset / 4) && isInt<8>(MinOffset / 4)) {
+ AFI->setJumpTableEntryInfo(JTIdx, 1, getJumpTablePICSymbol(JTIdx));
----------------
jfb wrote:
> Are there ever cases where min is large, but the range [min, max) would fit within 8 or 16 bits? I'm wondering if you want another optimization where you pack the jump offsets, and always add min (here you're using a base of 0).
Probably. A slight wrinkle is that if the PC-label isn't local it has a limit of +/-1MB, but I suspect that's significantly less likely than the limit that would be lifted. I'll update the patch with that approach.
================
Comment at: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:108
case AArch64::TLSDESC_CALLSEQ:
// This gets lowered to an instruction sequence which takes 16 bytes
NumBytes = 16;
----------------
jfb wrote:
> lol this comment
I have a horrible suspicion it'll have been one of mine.
Repository:
rL LLVM
https://reviews.llvm.org/D32564
More information about the llvm-commits
mailing list