Added sparse matrix impl. Used by copyopt_ilp
[libfirm] / ir / be / bera_t.h
index f14875b..8a70f66 100644 (file)
@@ -4,11 +4,12 @@
  * @date 8.12.2004
  */
 
-#ifndef _BERA_H
-#define _BERA_H
+#ifndef _BERA_T_H
+#define _BERA_T_H
 
 #include "firm_config.h"
 #include "bitset.h"
+#include "list.h"
 
 #include "bera.h"
 
@@ -20,7 +21,8 @@ typedef struct _ra_node_info_t {
 } ra_node_info_t;
 
 typedef struct _ra_block_info_t {
-       bitset_t *used_colors;          /**< A bitmask containing all colors used in the block. */
+       bitset_t *used_colors;                                  /**< A bitmask containing all colors used in the block. */
+       struct list_head border_head;           /**< A list head to enqueue the borders. */
 } ra_block_info_t;
 
 /**
@@ -64,26 +66,39 @@ void be_ra_init(void);
  */
 #define is_color(col) ((col) != NO_COLOR)
 
-static INLINE int __get_irn_color(const ir_node *irn)
+static INLINE int _get_irn_color(const ir_node *irn)
 {
        assert(!is_Block(irn) && "No block allowed here");
        return get_ra_node_info(irn)->color;
 }
 
-static INLINE void __set_irn_color(const ir_node *irn, int color)
+static INLINE void _set_irn_color(const ir_node *irn, int color)
 {
        assert(!is_Block(irn) && "No block allowed here");
        get_ra_node_info(irn)->color = color;
 }
 
-static INLINE int __is_allocatable_irn(const ir_node *irn)
+static INLINE int _is_allocatable_irn(const ir_node *irn)
 {
        assert(!is_Block(irn) && "No block allowed here");
        return mode_is_datab(get_irn_mode(irn));
 }
 
-#define get_irn_color(irn)                                                             __get_irn_color(irn)
-#define set_irn_color(irn,col)                                         __set_irn_color(irn, col)
-#define is_allocatable_irn(irn)                                                __is_allocatable_irn(irn)
+#define get_irn_color(irn)                                                             _get_irn_color(irn)
+#define set_irn_color(irn,col)                                         _set_irn_color(irn, col)
+#define is_allocatable_irn(irn)                                                _is_allocatable_irn(irn)
 
-#endif
+static INLINE struct list_head *_get_block_border_head(ir_node *block)
+{
+       return &get_ra_block_info(block)->border_head;
+}
+
+/**
+ * Check, if two phi operands interfere.
+ * @param a A node which is operand to a phi function.
+ * @param b Another node which is operand to a phi function.
+ * @return 1, if @p a and @p b interfere, 0 if not.
+ */
+int phi_ops_interfere(const ir_node *a, const ir_node *b);
+
+#endif /* BERA_T_H */