[PATCH] D110456: [CodeMoverUtils] Enhance isSafeToMoveBefore() when control flow equivalence is satisfied

Congzhe Cao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 24 16:36:22 PDT 2021


congzhe created this revision.
congzhe added a reviewer: Whitney.
congzhe added a project: LLVM.
Herald added a subscriber: hiraditya.
congzhe requested review of this revision.
Herald added a subscriber: llvm-commits.

With improved analysis in determining CFG equivalence that does not require strict dominance and post-dominance conditions, we now relax  isSafeToMoveBefore() such that an instruction I can be moved before InsertPoint even if they do not strictly dominate each other, as long as they follow the same control flow path.

For example,  we can move Instruction 0 before Instruction 1, and vice versa.

  if (cond1)
     // Instruction 0: %add = add i32 1, 2
  if (cond1)
     // Instruction 1: %add2 = add i32 2, 1


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110456

Files:
  llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h
  llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
  llvm/unittests/Transforms/Utils/CodeMoverUtilsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110456.374988.patch
Type: text/x-patch
Size: 5687 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210924/25034a0e/attachment.bin>


More information about the llvm-commits mailing list