HomePhabricator

[CodeMoverUtils] Added an API to check if an instruction can be safely moved…

Authored by Tsang Whitney W.H <whitneyt@recycler.canlab.ibm.com> on Nov 22 2019, 1:27 PM.

Description

[CodeMoverUtils] Added an API to check if an instruction can be safely moved before another instruction. Summary:Added an API to check if an instruction can be safely moved before another instruction. In future PRs, we will like to add support of moving instructions between blocks that are not control flow equivalent, and add other APIs to enhance usability, e.g. moving basic blocks, moving list of instructions... Loop Fusion will be its first user. When there is intervening code in between two loops, fusion is currently unable to fuse them. Loop Fusion can use this utility to check if the intervening code can be safely moved before or after the two loops, and move them, then it can successfully fuse them. Reviewer:kbarton,jdoerfert,Meinersbur,bmahjour,etiotto Reviewed By:bmahjour Subscribers:mgorny,hiraditya,llvm-commits Tag:LLVM Differential Revision:https://reviews.llvm.org/D70049

Details