summaryrefslogtreecommitdiffhomepage
path: root/ir/be/besched.h
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-07 03:04:54 +0200
committerChristoph Mallon <mallon@cs.uni-saarland.de>2015-07-07 14:33:19 +0200
commit2f0eeca3751e8628584a6a51c40c4a71b6051c37 (patch)
tree144955a169e33dbbe03e144200679ae859a5a48c /ir/be/besched.h
parent605f090a89439312aefdc8e01b209a6596ae9390 (diff)
be: Add and use macros to iterate only/all nodes except Phis in the schedule.
Diffstat (limited to 'ir/be/besched.h')
-rw-r--r--ir/be/besched.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ir/be/besched.h b/ir/be/besched.h
index af5f666..e340992 100644
--- a/ir/be/besched.h
+++ b/ir/be/besched.h
@@ -178,6 +178,10 @@ static inline bool value_strictly_dominates(const ir_node *a,
#define sched_foreach_reverse_before(before, irn) \
for (ir_node *irn = (before); !sched_is_begin(irn = sched_prev(irn));)
+#define sched_foreach_non_phi_reverse_before(before, irn) \
+ for (ir_node *irn = (before); !sched_is_begin(irn = sched_prev(irn));) \
+ if (is_Phi(irn)) break; else
+
/**
* A shorthand macro for iterating over a schedule.
* @param block The block.
@@ -186,6 +190,14 @@ static inline bool value_strictly_dominates(const ir_node *a,
#define sched_foreach(block,irn) \
sched_foreach_after((assert(is_Block(block)), block), irn)
+#define sched_foreach_phi(block, irn) \
+ sched_foreach(block, irn) \
+ if (!is_Phi(irn)) break; else
+
+#define sched_foreach_non_phi(block, irn) \
+ sched_foreach(block, irn) \
+ if (is_Phi(irn)) continue; else
+
/**
* A shorthand macro for reversely iterating over a schedule.
* @param block The block.
@@ -194,6 +206,9 @@ static inline bool value_strictly_dominates(const ir_node *a,
#define sched_foreach_reverse(block,irn) \
sched_foreach_reverse_before((assert(is_Block(block)), block), irn)
+#define sched_foreach_non_phi_reverse(block, irn) \
+ sched_foreach_non_phi_reverse_before((assert(is_Block(block)), block), irn)
+
/**
* A shorthand macro for iterating over a schedule while the current node may be
* removed or replaced.