[InstCombine] Remove instructions in dead blocks during combining
authorNikita Popov <npopov@redhat.com>
Wed, 24 May 2023 14:47:15 +0000 (16:47 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 26 May 2023 14:43:34 +0000 (16:43 +0200)
commitca18e21951a89f3115694fc64cd64a4b06cd5873
tree1a09003abcf7b5788a47438601ad918507cbbb2f
parenta1dec5dacbef2635d2de6533ba7cf686a78ca674
[InstCombine] Remove instructions in dead blocks during combining

We already do this during initial worklist population. Doing this
as part of primary combining allows us to remove instructions in
blocks that were rendered dead by condition folding within the
same instcombine iteration.
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/unreachable-code.ll