[PATCH] D12166: Assign weights to edges to jump table when lowering switch statement.

Cong Hou via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 12:57:27 PDT 2015


congh created this revision.
congh added reviewers: hfinkel, spatel, davidxl.
congh added a subscriber: llvm-commits.
Herald added a subscriber: jfb.

Currently, when lowering switch statement and a new basic block is built for jump table, the edge to this new block is not assigned with a correct weight. This patch collects the edge weight from all its successors and assign this sum of weights to the edge (and also the other fall-through edge). Test cases are adjusted accordingly.

http://reviews.llvm.org/D12166

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  test/CodeGen/ARM/jump-table-islands.ll
  test/CodeGen/Mips/nacl-align.ll
  test/CodeGen/X86/switch-jump-table.ll
  test/CodeGen/X86/switch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12166.32598.patch
Type: text/x-patch
Size: 3688 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150819/3a542dd3/attachment.bin>


More information about the llvm-commits mailing list