[PATCH] D140975: Support critical edge splitting for jump tables

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 06:07:45 PST 2023


MatzeB created this revision.
MatzeB added reviewers: qcolombet, efriedma, arsenm, craig.topper, fhahn.
Herald added subscribers: StephenFan, modimo, wenlei, pengfei, hiraditya, mcrosier.
Herald added a project: All.
MatzeB requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Add support for splitting critical edges coming from an indirect jump
using a jump table ("switch jumps").

This introduces the `TargetInstrInfo::getJumpTableIndex` callback to
allows targets to return an index into `MachineJumpTableInfo` for a
given indirect jump. It also updates to
`MachineBasicBlock::SplitCriticalEdge` to allow splitting of critical
edges by rewriting jump table entries.

This is largely based on work done by Zhixuan Huan in D132202 <https://reviews.llvm.org/D132202>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140975

Files:
  llvm/include/llvm/CodeGen/TargetInstrInfo.h
  llvm/lib/CodeGen/MachineBasicBlock.cpp
  llvm/lib/Target/X86/X86InstrInfo.cpp
  llvm/lib/Target/X86/X86InstrInfo.h
  llvm/test/CodeGen/X86/switch-jmp-edge-split.mir
  llvm/test/CodeGen/X86/switch-phi-const.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140975.486253.patch
Type: text/x-patch
Size: 16010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230104/0908d5c1/attachment.bin>


More information about the llvm-commits mailing list