[PATCH] D52002: Switch optimization for known maximum switch values

Ayonam Ray via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 28 09:24:44 PDT 2018


ayonam updated this revision to Diff 167495.
ayonam added a comment.

In this update I have broken down the original patch into two parts and this is the first part, which handles the unreachable default.  This part omits the generation of the conditional branch for checking the switch expression against the maximum value of the switch cases and jumping to the default block, if the default is unreachable.

It also removes the implementation that was redirecting the unreachable default to the most popular destination.

The next patch will handle the remaining part of the original patch which is to add a case statement for each known default value and direct it to the default block.


Repository:
  rL LLVM

https://reviews.llvm.org/D52002

Files:
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52002.167495.patch
Type: text/x-patch
Size: 7566 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180928/1cdbdf24/attachment.bin>


More information about the llvm-commits mailing list