[all-commits] [llvm/llvm-project] 4c16ea: [SCCP] Remove dead switch cases based on range inf...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Jul 30 12:21:31 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c16eafe12a5f0c82303511d9d3d7acb5ffe84e4
      https://github.com/llvm/llvm-project/commit/4c16eafe12a5f0c82303511d9d3d7acb5ffe84e4
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SCCP.cpp
    M llvm/test/Transforms/SCCP/switch.ll

  Log Message:
  -----------
  [SCCP] Remove dead switch cases based on range information

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.

Differential Revision: https://reviews.llvm.org/D84270




More information about the All-commits mailing list