[SimpleLoopUnswitch] Preserve make.implicit in non-trivial unswitch if legal
authorMax Kazantsev <mkazantsev@azul.com>
Fri, 31 Jul 2020 04:38:43 +0000 (11:38 +0700)
committerMax Kazantsev <mkazantsev@azul.com>
Fri, 31 Jul 2020 04:38:43 +0000 (11:38 +0700)
commit8aaeee5fb6d7c513d065e55b4bc2ad39bd6e760a
tree7165aed4587b26a51f6d3ae71933331e4a58bc27
parentd889e17eca8e8c43c6e4a2439fae5a1a40823623
[SimpleLoopUnswitch] Preserve make.implicit in non-trivial unswitch if legal

We can preserve make.implicit metadata in the split block if it is
guaranteed that after following the branch we always reach the block
where processing of null case happens, which is equivalent to
"initial condition must execute if the loop is entered".

Differential Revision: https://reviews.llvm.org/D84925
Reviewed By: asbirlea
llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
llvm/test/Transforms/SimpleLoopUnswitch/implicit-null-checks.ll