Clean up loop-closed PHIs after loop finalize
This patch propagates loop-closed PHIs them out at
loop_optimizer_finalize. For some cases, to clean up loop-closed PHIs
would save efforts of optimization passes after loopdone.
Thanks,
Jiufu Guo.
gcc/ChangeLog:
2020-10-18 Jiufu Guo <guojiufu@linux.ibm.com>
* cfgloop.h (loop_optimizer_finalize): Add flag argument.
* loop-init.c (loop_optimizer_finalize): Call clean_up_loop_closed_phi.
* tree-cfgcleanup.h (clean_up_loop_closed_phi): New declare.
* tree-ssa-loop.c (tree_ssa_loop_done): Call loop_optimizer_finalize
with flag argument.
* tree-ssa-propagate.c (clean_up_loop_closed_phi): New function.
gcc/testsuite/ChangeLog:
2020-10-18 Jiufu Guo <guojiufu@linux.ibm.com>
* gcc.dg/tree-ssa/loopclosedphi.c: New test.