summaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/Utils/OrderedInstructions.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Transforms/Utils/OrderedInstructions.h')
-rw-r--r--include/llvm/Transforms/Utils/OrderedInstructions.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/OrderedInstructions.h b/include/llvm/Transforms/Utils/OrderedInstructions.h
index 165d4bdaa6d4..7f57fde638b8 100644
--- a/include/llvm/Transforms/Utils/OrderedInstructions.h
+++ b/include/llvm/Transforms/Utils/OrderedInstructions.h
@@ -35,6 +35,11 @@ class OrderedInstructions {
/// The dominator tree of the parent function.
DominatorTree *DT;
+ /// Return true if the first instruction comes before the second in the
+ /// same basic block. It will create an ordered basic block, if it does
+ /// not yet exist in OBBMap.
+ bool localDominates(const Instruction *, const Instruction *) const;
+
public:
/// Constructor.
OrderedInstructions(DominatorTree *DT) : DT(DT) {}
@@ -42,6 +47,12 @@ public:
/// Return true if first instruction dominates the second.
bool dominates(const Instruction *, const Instruction *) const;
+ /// Return true if the first instruction comes before the second in the
+ /// dominator tree DFS traversal if they are in different basic blocks,
+ /// or if the first instruction comes before the second in the same basic
+ /// block.
+ bool dfsBefore(const Instruction *, const Instruction *) const;
+
/// Invalidate the OrderedBasicBlock cache when its basic block changes.
/// i.e. If an instruction is deleted or added to the basic block, the user
/// should call this function to invalidate the OrderedBasicBlock cache for