[LoopUnroll] Use changeToUnreachable() (NFC)
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 28 May 2021 20:38:36 +0000 (22:38 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 28 May 2021 22:11:21 +0000 (00:11 +0200)
commit90310dfff8fd17b0cabdee1fd72d675e5eb2aa78
tree8b94092ec98a35befbd3f97d636f52382c03db7d
parentbc6799f2f79f0ae87e9f1ebf9d25ba799fbd25a9
[LoopUnroll] Use changeToUnreachable() (NFC)

When fulling unrolling with a non-latch exit, the latch block is
folded to unreachable. Replace this folding with the existing
changeToUnreachable() helper, rather than performing it manually.

This also moves the fold to happen after the manual DT update
for exit blocks. I believe this is correct in that the conversion
of an unconditional backedge into unreachable should not affect
the DT at all.

Differential Revision: https://reviews.llvm.org/D103340
llvm/lib/Transforms/Utils/LoopUnroll.cpp