[PATCH] D70049: [CodeMoverUtils] Added an API to check if an instruction can be safely moved before another instruction.

Whitney Tsang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 9 20:50:29 PST 2019


Whitney created this revision.
Whitney added reviewers: kbarton, jdoerfert, Meinersbur, bmahjour, etiotto.
Whitney added a project: LLVM.
Herald added subscribers: llvm-commits, hiraditya, mgorny.

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 PHINode, Terminators, 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.


Repository:
  rL LLVM

https://reviews.llvm.org/D70049

Files:
  llvm/include/llvm/Analysis/PostDominators.h
  llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
  llvm/lib/Analysis/PostDominators.cpp
  llvm/lib/Transforms/Utils/CMakeLists.txt
  llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
  llvm/unittests/Transforms/Utils/CMakeLists.txt
  llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70049.228592.patch
Type: text/x-patch
Size: 17947 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191110/a7eaed4d/attachment.bin>


More information about the llvm-commits mailing list