[LoopFuse] Ensure loops are in loop simplified form under new PM
authorMengxuan Cai <mengxuan.cai@huawei.com>
Mon, 31 Oct 2022 15:45:44 +0000 (11:45 -0400)
committerCongzheUalberta <congzhecao@gmail.com>
Mon, 31 Oct 2022 15:46:28 +0000 (11:46 -0400)
commiteda3c93486ca113f63ccf8f28ca9c0ea90c09386
tree68e457c4a473142b9ce0d57130fdb4687cd4a493
parentaee2a35ac4ab4fe62bb0ce4e314966ab9207efd1
[LoopFuse] Ensure loops are in loop simplified form under new PM

Loop Fusion (Function Pass) requires loops in simplified form. With
legacy-pm, loop-simplify pass is added as a dependency for loop-fusion.
But the new pass manager does not always ensure this format. This patch
tries to invoke simplifyLoop() on loops that are not in simplified form
only for new PM.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D136781
llvm/lib/Transforms/Scalar/LoopFuse.cpp
llvm/test/Transforms/LoopFusion/ensure_loop_simplify_form.ll [new file with mode: 0644]