Added new arch interface
[libfirm] / ir / be / bera_t.h
index f14875b..5b83b8a 100644 (file)
@@ -4,23 +4,27 @@
  * @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"
 
 #define DBG_BERA "firm.be.ra"
 
 typedef struct _ra_node_info_t {
+       ir_node *spill_location;  /**< Spill location node of the node.
+                                                                                                                       If NULL, the node is not spilled. */
        int pressure;                                                   /**< Register pressure at this node. */
        int color;                                                              /**< The color assigned to this node. */
 } 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;
 
 /**
@@ -39,6 +43,8 @@ typedef struct _ra_info_t {
 #define get_ra_node_info(the_node)             (&get_ra_irn_info(the_node)->v.node)
 #define get_ra_block_info(the_block)   (&get_ra_irn_info(the_block)->v.block)
 
+#define get_block_border_head(bl)     (&get_ra_block_info(bl)->border_head)
+
 extern size_t ra_irn_data_offset;
 
 extern size_t ra_irg_data_offset;
@@ -64,26 +70,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)
+
+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
+#endif /* BERA_T_H */