aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-10-31 21:51:10 +0000
committerChris Lattner <sabre@nondot.org>2009-10-31 21:51:10 +0000
commit1b98ff3e4fb81f83a9c8d04f6b063cbb2114af65 (patch)
treebe5dc40d6876509a9a7face385d9061bd9982a29 /include
parentbcf2f2c1592c96b3adcfd784e0699e8c55f65e5b (diff)
downloadexternal_llvm-1b98ff3e4fb81f83a9c8d04f6b063cbb2114af65.zip
external_llvm-1b98ff3e4fb81f83a9c8d04f6b063cbb2114af65.tar.gz
external_llvm-1b98ff3e4fb81f83a9c8d04f6b063cbb2114af65.tar.bz2
update the comment above llvm::SplitCriticalEdge, and make
it abort on IndirectBrInst as describe in the comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/BasicBlockUtils.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/llvm/Transforms/Utils/BasicBlockUtils.h b/include/llvm/Transforms/Utils/BasicBlockUtils.h
index e766d72..1dc5a96 100644
--- a/include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ b/include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -116,8 +116,8 @@ 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 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.
+/// will not invalidate either of them. This returns the new block if the edge
+/// was split, null otherwise.
///
/// If MergeIdenticalEdges is true (not the default), *all* edges from TI to the
/// specified successor will be merged into the same critical edge block.
@@ -126,10 +126,16 @@ bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
/// dest go to one block instead of each going to a different block, but isn't
/// the standard definition of a "critical edge".
///
+/// It is invalid to call this function on a critical edge that starts at an
+/// IndirectBrInst. Splitting these edges will almost always create an invalid
+/// program because the addr of the new block won't be the one that is jumped
+/// to.
+///
BasicBlock *SplitCriticalEdge(TerminatorInst *TI, unsigned SuccNum,
Pass *P = 0, bool MergeIdenticalEdges = false);
-inline BasicBlock *SplitCriticalEdge(BasicBlock *BB, succ_iterator SI, Pass *P = 0) {
+inline BasicBlock *SplitCriticalEdge(BasicBlock *BB, succ_iterator SI,
+ Pass *P = 0) {
return SplitCriticalEdge(BB->getTerminator(), SI.getSuccessorIndex(), P);
}