[PATCH] Use DomTree in MachineSink to sink over diamonds.

Patrik Hägglund H patrik.h.hagglund at ericsson.com
Wed Dec 3 05:08:27 PST 2014


This is a patch provided by Jonas Paulsson.

@Manman Ren: Can you check the change in test/CodeGen/X86/ragreedy-hoist-spill.ll?


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.
---
lib/CodeGen/MachineSink.cpp              | 34 ++++++++++++++++++--------------
test/CodeGen/X86/ragreedy-hoist-spill.ll |  1 -
2 files changed, 19 insertions(+), 16 deletions(-)


/Patrik Hägglund
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141203/80e222aa/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Use-DomTree-in-MachineSink-to-sink-over-diamonds.patch
Type: application/octet-stream
Size: 4594 bytes
Desc: 0001-Use-DomTree-in-MachineSink-to-sink-over-diamonds.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141203/80e222aa/attachment.obj>


More information about the llvm-commits mailing list