OSDN Git Service

Use DomTree in MachineSink to sink over diamonds.
authorPatrik Hagglund <patrik.h.hagglund@ericsson.com>
Thu, 4 Dec 2014 10:36:42 +0000 (10:36 +0000)
committerPatrik Hagglund <patrik.h.hagglund@ericsson.com>
Thu, 4 Dec 2014 10:36:42 +0000 (10:36 +0000)
commitcfb121f2869b538878f05382d5c8881877466476
treeaaf16fce4a5595480883b5e5d5ac5c377b246e35
parent94590ca4cfdc6ae0b7157829c559deea831c854f
Use DomTree in MachineSink to sink over diamonds.

According to a previous FIXME comment we now not only look at MBB
successors, but also handle code sinking past them:

  x = computation
  if () {} else {}
  use x

The instruction could be sunk over the whole diamond for the
if/then/else (or loop, etc), allowing it to be sunk into other blocks
after that.

Modified test added in r204522, due to one spill less present.

Minor fixes in comments.

Patch provided by Jonas Paulsson. Reviewed by Hal Finkel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223350 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineSink.cpp
test/CodeGen/X86/ragreedy-hoist-spill.ll