[llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h

Chris Lattner lattner at cs.uiuc.edu
Sun Nov 9 22:11:21 PST 2003


Changes in directory llvm/include/llvm/Transforms/Utils:

BasicBlockUtils.h updated: 1.5 -> 1.6

---
Log message:

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.


---
Diffs of the changes:  (+16 -0)

Index: llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
diff -u llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:1.5 llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:1.6
--- llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h:1.5	Mon Oct 20 15:19:47 2003
+++ llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h	Sun Nov  9 22:10:27 2003
@@ -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.
@@ -47,5 +48,20 @@
 // suprising change in program behavior if it is not expected.
 //
 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





More information about the llvm-commits mailing list