summaryrefslogtreecommitdiffhomepage
path: root/ir/be/besched.h
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2014-07-16 14:04:59 +0200
committerMatthias Braun <matze@braunis.de>2014-07-18 10:04:10 +0200
commitd1b570dc09178836421ebe47ca98eed7c6709798 (patch)
treea4558dc4ed932e58dded9a2c5f2bc8a5d01856c5 /ir/be/besched.h
parent8f1ba92ac594742f9b73902256cdb3a60b29b730 (diff)
remove beintlive_t header
Move the values interfere function to belive.h, move the inline implementation into belive.c
Diffstat (limited to 'ir/be/besched.h')
-rw-r--r--ir/be/besched.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/ir/be/besched.h b/ir/be/besched.h
index 61359a9..acebb24 100644
--- a/ir/be/besched.h
+++ b/ir/be/besched.h
@@ -14,6 +14,8 @@
#include <stdbool.h>
#include "beinfo.h"
+#include "beutil.h"
+#include "irdom.h"
static sched_info_t *get_irn_sched_info(const ir_node *node)
{
@@ -157,6 +159,27 @@ static inline bool sched_comes_before(const ir_node *a, const ir_node *b)
return as < bs;
}
+/**
+ * Check, if one value dominates the other.
+ * The dominance is not strict here.
+ * @param a The first node.
+ * @param b The second node.
+ * @return true if a dominates b or if a == b.
+ */
+static inline bool value_strictly_dominates(const ir_node *a,
+ const ir_node *b)
+{
+ /* if a and b are not in the same block, dominance is determined by the
+ * dominance of the blocks. */
+ const ir_node *block_a = get_block_const(a);
+ const ir_node *block_b = get_block_const(b);
+ if (block_a != block_b)
+ return block_dominates(block_a, block_b);
+
+ /* Dominance is determined by schedule. */
+ return sched_comes_before(a, b);
+}
+
#define sched_foreach_after(after, irn) \
for (ir_node *irn = (after); !sched_is_end(irn = sched_next(irn));)