aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-08-16 15:09:43 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-08-16 15:09:43 +0000
commit05130597262f3ed00dc4881d64795d117c76e3fc (patch)
treee2ce3458ce795313234a1bde18158542a0907a44 /include
parent52b7ec68d221d65aacbe9b55de325c9b7370b59d (diff)
downloadexternal_llvm-05130597262f3ed00dc4881d64795d117c76e3fc.zip
external_llvm-05130597262f3ed00dc4881d64795d117c76e3fc.tar.gz
external_llvm-05130597262f3ed00dc4881d64795d117c76e3fc.tar.bz2
Teach GVN to reason about edges dominating uses. This allows it to handle cases
where some fact lake a=b dominates a use in a phi, but doesn't dominate the basic block itself. This feature could also be implemented by splitting critical edges, but at least with the current algorithm reasoning about the dominance directly is faster. The time for running "opt -O2" in the testcase in pr10584 is 1.003 times slower and on gcc as a single file it is 1.0007 times faster. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/Dominators.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/llvm/Analysis/Dominators.h b/include/llvm/Analysis/Dominators.h
index 1289edd..a1cc196 100644
--- a/include/llvm/Analysis/Dominators.h
+++ b/include/llvm/Analysis/Dominators.h
@@ -705,7 +705,20 @@ DominatorTreeBase<NodeT>::properlyDominates(const NodeT *A, const NodeT *B) {
EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase<BasicBlock>);
-class BasicBlockEdge;
+class BasicBlockEdge {
+ const BasicBlock *Start;
+ const BasicBlock *End;
+public:
+ BasicBlockEdge(const BasicBlock *Start_, const BasicBlock *End_) :
+ Start(Start_), End(End_) { }
+ const BasicBlock *getStart() const {
+ return Start;
+ }
+ const BasicBlock *getEnd() const {
+ return End;
+ }
+ bool isSingleEdge() const;
+};
//===-------------------------------------
/// DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to