[all-commits] [llvm/llvm-project] 34d9ea: [RISCV] Support getJumpTableIndex (#224197)
Piyou Chen via All-commits
all-commits at lists.llvm.org
Wed Sep 23 18:21:33 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 34d9eab9d702da1c63fd82349ec9cb10834f3ade
https://github.com/llvm/llvm-project/commit/34d9eab9d702da1c63fd82349ec9cb10834f3ade
Author: Piyou Chen <piyou.chen at sifive.com>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
M llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
M llvm/lib/Target/RISCV/RISCVInstrInfo.h
A llvm/test/CodeGen/RISCV/machine-sink-jumptable-edge-split.ll
Log Message:
-----------
[RISCV] Support getJumpTableIndex (#224197)
This patch implements getJumpTableIndex hook for RISC-V; it trace from
PseudoBRIND back to the %jump-table.N.
The li instruction in jumptable dispatch block exists because the phi
constant is emitted during instruction selection. LLVM chooses the
source block in which to place the phi constant, then postpones moving
it to MachineSink, which relocates the phi constant closer to its use
site. However, to sink it out of the jump table dispatch block,
MachineSink needs to split the critical edge, which requires updating
the jump table entry. It needs the getJumpTableIndex hook to know which
jump table to update.
This avoids unnecessary instructions in the hot path (the jump table
dispatch block).
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list