[MachineSink] Use the real post dominator tree
authorJingyue Wu <jingyue@google.com>
Mon, 1 Sep 2014 03:47:25 +0000 (03:47 +0000)
committerJingyue Wu <jingyue@google.com>
Mon, 1 Sep 2014 03:47:25 +0000 (03:47 +0000)
commitd43e6df10b85ee4a4dfd8dc164eff1177d4eb8d2
treeccd2c209bccb917294bd1e2249f2ad0dbd949ac3
parente2cf6dc5c9193f52354aedd728a2a43ff5ebaa3b
[MachineSink] Use the real post dominator tree

Summary:
Fixes a FIXME in MachineSinking. Instead of using the simple heuristics
in isPostDominatedBy, use the real MachinePostDominatorTree. The old
heuristics caused instructions to sink unnecessarily, and might create
register pressure.

Test Plan:
Added a NVPTX codegen test to verify that our change is in effect. It also
shows the unnecessary register pressure caused by over-sinking. Updated
affected tests in AArch64 and X86.

Reviewers: eliben, meheff, Jiangning

Reviewed By: Jiangning

Subscribers: jholewinski, aemerson, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D4814

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216862 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineSink.cpp
test/CodeGen/AArch64/arm64-atomic.ll
test/CodeGen/NVPTX/machine-sink.ll [new file with mode: 0644]
test/CodeGen/X86/loop-strength-reduce8.ll