[PATCH] D159297: [X86] Use 64-bit jump table entries for large code model PIC

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 10:36:43 PDT 2023


aeubanks created this revision.
aeubanks added reviewers: rnk, efriedma.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

With the large code model, the label difference may not fit into 32 bits.
Even if we assume that any individual function is no larger than 2^32
and use a difference from the function entry to the target destination,
things like BOLT can rearrange blocks (even if BOLT doesn't necessarily
work with the large code model right now).

set directives avoid static relocations in some 32-bit entry cases, but
don't worry about set directives for 64-bit jump table entries (we can
do that later if somebody really cares about it).

check-llvm in a bootstrapped clang with the large code model passes.

Fixes #62894


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159297

Files:
  llvm/include/llvm/CodeGen/MIRYamlMapping.h
  llvm/include/llvm/CodeGen/MachineJumpTableInfo.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/MachineFunction.cpp
  llvm/lib/Target/X86/X86ISelLoweringCall.cpp
  llvm/test/CodeGen/X86/large-pic-jump-table.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159297.555097.patch
Type: text/x-patch
Size: 6218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230831/2ceefb41/attachment.bin>


More information about the llvm-commits mailing list