[llvm-dev] How jump-table representated in DAG

Hans Wennborg via llvm-dev llvm-dev at lists.llvm.org
Tue May 22 03:09:16 PDT 2018


Hi Yao,

On Tue, May 22, 2018 at 4:30 AM, yao via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hi, all
>
> I am  interested in how jump-table representated in DAG.
> I find the method  visitJumpTable will Emit JumpTable node in the current
> MBB.
>  visitJumpTableHeader - This function emits necessary code to produce index
> in the JumpTable from switch case.
> but how  switch case emits?
>
> I would like to make this clearly.

It sounds like you're already looking in the right places.

The switch lowering starts in SelectionDAGBuilder::visitSwitch which
analyses the switch and decides how to lower it. For jump tables, it
calls SelectionDAGBuilder::buildJumpTable which creates and populates
the JumpTable and JumpTableHeader

Hope this helps,
Hans


More information about the llvm-dev mailing list