summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SplitKit.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-09-14 16:45:39 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-09-14 16:45:39 +0000
commitc4c633852fbb8ab9ef2679b679d2862746d2fa3e (patch)
tree5b90b80896129848d5bbc51e5d695c23a6016b80 /lib/CodeGen/SplitKit.h
parent6148225b9590f18fcb6a1d3151d3158b316965e0 (diff)
downloadllvm-c4c633852fbb8ab9ef2679b679d2862746d2fa3e.tar.gz
llvm-c4c633852fbb8ab9ef2679b679d2862746d2fa3e.tar.bz2
llvm-c4c633852fbb8ab9ef2679b679d2862746d2fa3e.tar.xz
Hoist back-copies to the least busy dominator.
When a back-copy is hoisted to the nearest common dominator, keep looking up the dominator tree for a less loopy dominator, and place the back-copy there instead. Don't do this when a single existing back-copy dominates all the others. Assume the client knows what he is doing, and keep the dominating back-copy. This prevents us from hoisting back-copies into loops in most cases. If a value is defined in a loop with multiple exits, we may still hoist back-copies into that loop. That is the speed/size tradeoff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139698 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SplitKit.h')
-rw-r--r--lib/CodeGen/SplitKit.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SplitKit.h b/lib/CodeGen/SplitKit.h
index 5a294e5055..d8fc2122a3 100644
--- a/lib/CodeGen/SplitKit.h
+++ b/lib/CodeGen/SplitKit.h
@@ -315,6 +315,11 @@ private:
/// in the vector in the complement interval.
void removeBackCopies(SmallVectorImpl<VNInfo*> &Copies);
+ /// getShallowDominator - Returns the least busy dominator of MBB that is
+ /// also dominated by DefMBB. Busy is measured by loop depth.
+ MachineBasicBlock *findShallowDominator(MachineBasicBlock *MBB,
+ MachineBasicBlock *DefMBB);
+
/// hoistCopiesForSize - Hoist back-copies to the complement interval in a
/// way that minimizes code size. This implements the SM_Size spill mode.
void hoistCopiesForSize();