[LoopVersioning] Form dedicated exits for versioned loop to preserve simplify form
authorTaWeiTu <tu.da.wei@gmail.com>
Sat, 24 Oct 2020 13:39:42 +0000 (21:39 +0800)
committerTaWeiTu <tu.da.wei@gmail.com>
Sat, 24 Oct 2020 13:40:46 +0000 (21:40 +0800)
commit060a4fccf101b120cc9c36d4aa1041ee07044766
tree95abe68e306bbbcfab4202b6268daaf21b0b04b5
parente9955b0843cc1e5876430f3f051494d4197419f3
[LoopVersioning] Form dedicated exits for versioned loop to preserve simplify form

The exit blocks of the versioned and non-versioned loops are not dedicated and thus the two loops are not in simplify form.
Insert dummy exit blocks after loop versioning with `formDedicatedExits()` to preserve the simplify form for subsequence passes.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D89569
llvm/lib/Transforms/Utils/LoopVersioning.cpp
llvm/test/Transforms/LoopDistribute/basic-with-memchecks.ll
llvm/test/Transforms/LoopDistribute/followup.ll
llvm/test/Transforms/LoopDistribute/outside-use.ll
llvm/test/Transforms/LoopDistribute/scev-inserted-runtime-check.ll
llvm/test/Transforms/LoopVersioning/add-phi-update-users.ll
llvm/test/Transforms/LoopVersioning/basic.ll
llvm/test/Transforms/LoopVersioning/incorrect-phi.ll