[all-commits] [llvm/llvm-project] 5d4f37: [NFCI][SimplifyCFG] Rewrite `createUnreachableSwit...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Aug 20 03:28:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d4f37e895487408e61498ec42e545ec5f778b5b
      https://github.com/llvm/llvm-project/commit/5d4f37e895487408e61498ec42e545ec5f778b5b
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-08-20 (Fri, 20 Aug 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/SimplifyCFG/switch-dead-default.ll

  Log Message:
  -----------
  [NFCI][SimplifyCFG] Rewrite `createUnreachableSwitchDefault()`

The only thing that function should do as per it's semantic,
is to ensure that the switch's default is a block consisting only of
an `unreachable` terminator.

So let's just create such a block and update switch's default
to point to it. There should be no need for all this weird dance
around predecessors/successors.




More information about the All-commits mailing list