summaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/Utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-10 04:10:27 +0000
committerChris Lattner <sabre@nondot.org>2003-11-10 04:10:27 +0000
commitd9c5c5e12ff2d8856da61c3fa009d0f960255029 (patch)
treeadd1ba10b5aec80e96a988a2ac97a0bd7f50eef0 /include/llvm/Transforms/Utils
parent4a05ba0ab599c085e338cff47ad546ab1520f6e5 (diff)
downloadllvm-d9c5c5e12ff2d8856da61c3fa009d0f960255029.tar.gz
llvm-d9c5c5e12ff2d8856da61c3fa009d0f960255029.tar.bz2
llvm-d9c5c5e12ff2d8856da61c3fa009d0f960255029.tar.xz
Move isCriticalEdge & SplitCritical into this file. While we're at it, change
the interface to SplitCriticalEdge so that it splits an edge if it is critical, otherwise just returns false and noops if not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms/Utils')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index 53452eb1cd..78e5592f44 100644
--- a/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -19,6 +19,7 @@
#include "llvm/BasicBlock.h"
class Instruction;
+class Pass;
// ReplaceInstWithValue - Replace all uses of an instruction (specified by BI)
// with a value, then remove and delete the original instruction.
@@ -48,4 +49,19 @@ void ReplaceInstWithInst(Instruction *From, Instruction *To);
//
void RemoveSuccessor(TerminatorInst *TI, unsigned SuccNum);
+
+/// isCriticalEdge - Return true if the specified edge is a critical edge.
+/// Critical edges are edges from a block with multiple successors to a block
+/// with multiple predecessors.
+///
+bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum);
+
+/// SplitCriticalEdge - If this edge is a critical edge, insert a new node to
+/// split the critical edge. This will update DominatorSet, ImmediateDominator,
+/// DominatorTree, and DominatorFrontier information if it is available, thus
+/// calling this pass will not invalidate either of them. This returns true if
+/// the edge was split, false otherwise.
+///
+bool SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum, Pass *P = 0);
+
#endif