[PATCH] D84270: [SCCP] Remove dead switch cases based on range information
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 21 14:21:29 PDT 2020
nikic created this revision.
nikic added reviewers: fhahn, efriedma.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
Determine whether switch edges are feasible based on range information, and remove non-feasible edges lateron.
This does not try to determine whether the default edge is dead, as we'd have to determine that the range is fully covered by the cases for that.
Another limitation here is that we don't remove dead cases that have the same successor as a live case. I'm not handling this because I wanted to keep the edge removal based on feasible edges only, rather than inspecting ranges again there -- this does not seem like a particularly useful case to handle.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D84270
Files:
llvm/lib/Transforms/Scalar/SCCP.cpp
llvm/test/Transforms/SCCP/switch.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84270.279632.patch
Type: text/x-patch
Size: 4414 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200721/ad73d8cc/attachment.bin>
More information about the llvm-commits
mailing list