#include "irnode.h"
#include "debug.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "../beemitter.h"
#include "bearch_TEMPLATE_t.h"
#include "irnode.h"
#include "set.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "TEMPLATE_nodes_attr.h"
int TEMPLATE_cmp_irn_reg_assoc(const void *a, const void *b, size_t len);
#include "irprintf.h"
#include "xmalloc.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "TEMPLATE_nodes_attr.h"
#include "TEMPLATE_new_nodes.h"
#ifndef FIRM_BE_TEMPLATE_TEMPLATE_NODES_ATTR_H
#define FIRM_BE_TEMPLATE_TEMPLATE_NODES_ATTR_H
-#include "../bearch_t.h"
+#include "../bearch.h"
typedef struct TEMPLATE_attr_t TEMPLATE_attr_t;
#include "bitset.h"
#include "debug.h"
-#include "../bearch_t.h"
+#include "be.h"
+#include "../bearch.h"
#include "../benode_t.h"
#include "../belower.h"
-#include "../besched_t.h"
-#include "be.h"
+#include "../besched.h"
#include "../beabi.h"
#include "../bemodule.h"
#include "../begnuas.h"
+#include "../belistsched.h"
#include "bearch_TEMPLATE_t.h"
#ifndef FIRM_BE_TEMPLATE_BEARCH_TEMPLATE_H
#define FIRM_BE_TEMPLATE_BEARCH_TEMPLATE_H
-#include "../bearch_t.h"
+#include "../bearch.h"
extern const arch_isa_if_t TEMPLATE_isa_if;
#include "../besched.h"
#include "../beblocksched.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
#include "../begnuas.h"
#include "../be_dbgout.h"
#include "irargs_t.h"
#include "debug.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "bearch_arm_t.h"
#include "irnode.h"
#include "set.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "arm_nodes_attr.h"
const arch_register_t *arm_get_RegParam_reg(int n);
#include "irprintf.h"
#include "xmalloc.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "arm_nodes_attr.h"
#include "arm_new_nodes.h"
#include "firm_types.h"
#include "irnode_t.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
/**
* Possible ARM register shift types.
#include "error.h"
#include "../benode_t.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
#include "../beutil.h"
#include "../betranshlp.h"
#include "bearch_arm_t.h"
#include "array_t.h"
#include "irtools.h"
-#include "../bearch_t.h" /* the general register allocator interface */
+#include "../bearch.h" /* the general register allocator interface */
#include "../benode_t.h"
#include "../belower.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "be.h"
#include "../beabi.h"
#include "../bemachine.h"
#include "../beilpsched.h"
#include "../bemodule.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
#include "../bespillslots.h"
#include "../begnuas.h"
+#include "../belistsched.h"
#include "bearch_arm_t.h"
#ifndef FIRM_BE_ARM_BEARCH_ARM_H
#define FIRM_BE_ARM_BEARCH_ARM_H
-#include "../bearch_t.h"
+#include "../bearch.h"
extern const arch_isa_if_t arm_isa_if;
#define FIRM_BE_BE_DBGOUT_T_H
#include "obst.h"
-#include "beabi_t.h"
#include "firm_types.h"
+#include "be_types.h"
typedef struct dbg_handle dbg_handle;
#include "pmap.h"
#include "be.h"
-#include "bearch_t.h"
-#include "beirg.h"
+#include "be_types.h"
#define DUMP_NONE 0
#define DUMP_INITIAL (1 << 0)
--- /dev/null
+/*
+ * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
+ *
+ * This file is part of libFirm.
+ *
+ * This file may be distributed and/or modified under the terms of the
+ * GNU General Public License version 2 as published by the Free Software
+ * Foundation and appearing in the file LICENSE.GPL included in the
+ * packaging of this file.
+ *
+ * Licensees holding valid libFirm Professional Edition licenses may use
+ * this file in accordance with the libFirm Commercial License.
+ * Agreement provided with the Software.
+ *
+ * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+ * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ */
+
+/**
+ * @file
+ * @brief Forward declarations of backend types
+ * @author Matthias Braun
+ * @version $Id: besched.h 25982 2009-05-15 22:09:38Z matze $
+ */
+#ifndef FIRM_BE_TYPES_H
+#define FIRM_BE_TYPES_H
+
+typedef unsigned int sched_timestep_t;
+typedef struct be_irg_t be_irg_t;
+
+typedef struct arch_register_class_t arch_register_class_t;
+typedef struct arch_register_req_t arch_register_req_t;
+typedef struct arch_register_t arch_register_t;
+typedef struct arch_flag_t arch_flag_t;
+typedef struct arch_inverse_t arch_inverse_t;
+typedef struct arch_isa_if_t arch_isa_if_t;
+typedef struct arch_env_t arch_env_t;
+typedef struct arch_code_generator_t arch_code_generator_t;
+typedef struct arch_code_generator_if_t arch_code_generator_if_t;
+
+/**
+ * Some flags describing a node in more detail.
+ */
+typedef enum arch_irn_flags_t {
+ arch_irn_flags_none = 0, /**< Node flags. */
+ arch_irn_flags_dont_spill = 1U << 0, /**< This must not be spilled. */
+ arch_irn_flags_rematerializable = 1U << 1, /**< This can be replicated instead of spilled/reloaded. */
+ arch_irn_flags_modify_flags = 1U << 2 /**< I modify flags. */
+} arch_irn_flags_t;
+
+typedef struct _be_lv_t be_lv_t;
+typedef struct _be_lv_info_t be_lv_info_t;
+
+typedef struct _be_abi_call_flags_bits_t be_abi_call_flags_bits_t;
+typedef union _be_abi_call_flags_t be_abi_call_flags_t;
+typedef struct _be_abi_callbacks_t be_abi_callbacks_t;
+typedef struct _be_abi_call_t be_abi_call_t;
+typedef struct _be_abi_irg_t be_abi_irg_t;
+typedef struct _be_stack_layout_t be_stack_layout_t;
+
+typedef struct _be_dom_front_info_t be_dom_front_info_t;
+
+typedef struct _list_sched_selector_t list_sched_selector_t;
+
+typedef struct _ilp_sched_selector_t ilp_sched_selector_t;
+typedef struct _ilp_sched_selector_if_t ilp_sched_selector_if_t;
+
+typedef struct _be_execution_unit_type_t be_execution_unit_type_t;
+typedef struct _be_execution_unit_t be_execution_unit_t;
+typedef struct _be_machine_t be_machine_t;
+
+typedef struct backend_info_t backend_info_t;
+typedef struct sched_info_t sched_info_t;
+typedef struct reg_out_info_t reg_out_info_t;
+
+#endif
#include "be.h"
#include "beabi.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "benode_t.h"
#include "belive_t.h"
-#include "besched_t.h"
-#include "beirg_t.h"
+#include "besched.h"
+#include "beirg.h"
#include "bessaconstr.h"
typedef struct _be_abi_call_arg_t {
#include "be.h"
#include "beirg.h"
#include "bearch.h"
-#include "beabi_t.h"
+#include "beabi.h"
struct _be_abi_call_flags_bits_t {
unsigned left_to_right : 1; /**< Arguments are from left to right. */
+++ /dev/null
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief Type declarations for the ABI module.
- * @author Sebastian Hack
- * @version $Id$
- */
-#ifndef FIRM_BE_BEABI_T_H
-#define FIRM_BE_BEABI_T_H
-
-typedef struct _be_abi_call_flags_bits_t be_abi_call_flags_bits_t;
-typedef union _be_abi_call_flags_t be_abi_call_flags_t;
-typedef struct _be_abi_callbacks_t be_abi_callbacks_t;
-typedef struct _be_abi_call_t be_abi_call_t;
-typedef struct _be_abi_irg_t be_abi_irg_t;
-typedef struct _be_stack_layout_t be_stack_layout_t;
-
-#endif /* FIRM_BE_BEABI_T_H */
#include <string.h>
-#include "bearch_t.h"
+#include "bearch.h"
#include "benode_t.h"
#include "beinfo.h"
#include "ircons_t.h"
#include "firm_types.h"
#include "bitset.h"
-#include "be.h"
#include "obst.h"
+#include "raw_bitset.h"
-typedef struct arch_register_class_t arch_register_class_t;
-typedef struct arch_register_req_t arch_register_req_t;
-typedef struct arch_register_t arch_register_t;
-typedef struct arch_flag_t arch_flag_t;
-typedef struct arch_inverse_t arch_inverse_t;
-typedef struct arch_isa_if_t arch_isa_if_t;
-typedef struct arch_env_t arch_env_t;
-typedef struct arch_code_generator_t arch_code_generator_t;
-typedef struct arch_code_generator_if_t arch_code_generator_if_t;
+#include "be_types.h"
+#include "beinfo.h"
+#include "be.h"
+#include "beirg.h"
typedef enum arch_register_class_flags_t {
arch_register_class_flag_none = 0,
arch_irn_class_branch = 1 << 5
} arch_irn_class_t;
-/**
- * Some flags describing a node in more detail.
- */
-typedef enum arch_irn_flags_t {
- arch_irn_flags_none = 0, /**< Node flags. */
- arch_irn_flags_dont_spill = 1U << 0, /**< This must not be spilled. */
- arch_irn_flags_rematerializable = 1U << 1, /**< This can be replicated instead of spilled/reloaded. */
- arch_irn_flags_modify_flags = 1U << 2 /**< I modify flags. */
-} arch_irn_flags_t;
-
void arch_set_frame_offset(ir_node *irn, int bias);
ir_entity *arch_get_frame_entity(const ir_node *irn);
*/
void be_register_isa_if(const char *name, const arch_isa_if_t *isa);
+/**
+ * A register.
+ */
+struct arch_register_t {
+ const char *name; /**< The name of the register. */
+ const arch_register_class_t *reg_class; /**< The class the register belongs to. */
+ unsigned index; /**< The index of the register in the class. */
+ arch_register_type_t type; /**< The type of the register. */
+};
+
+static inline const arch_register_class_t *
+_arch_register_get_class(const arch_register_t *reg)
+{
+ return reg->reg_class;
+}
+
+static inline
+unsigned _arch_register_get_index(const arch_register_t *reg)
+{
+ return reg->index;
+}
+
+static inline
+const char *_arch_register_get_name(const arch_register_t *reg)
+{
+ return reg->name;
+}
+
+#define arch_register_get_class(reg) _arch_register_get_class(reg)
+#define arch_register_get_index(reg) _arch_register_get_index(reg)
+#define arch_register_get_name(reg) _arch_register_get_name(reg)
+
+/**
+ * Convenience macro to check for register type.
+ * @param req A pointer to register.
+ * @param kind The kind of type to check for (see arch_register_type_t).
+ * @return 1, If register is of given kind, 0 if not.
+ */
+#define arch_register_type_is(reg, kind) \
+ (((reg)->type & arch_register_type_ ## kind) != 0)
+
+/**
+ * A class of registers.
+ * Like general purpose or floating point.
+ */
+struct arch_register_class_t {
+ unsigned index; /**< index of this register class */
+ const char *name; /**< The name of the register class.*/
+ unsigned n_regs; /**< Number of registers in this
+ class. */
+ ir_mode *mode; /**< The mode of the register class.*/
+ const arch_register_t *regs; /**< The array of registers. */
+ arch_register_class_flags_t flags; /**< register class flags. */
+};
+
+/** return the number of registers in this register class */
+#define arch_register_class_n_regs(cls) ((cls)->n_regs)
+
+/** return the largest mode of this register class */
+#define arch_register_class_mode(cls) ((cls)->mode)
+
+/** return the name of this register class */
+#define arch_register_class_name(cls) ((cls)->name)
+
+/** return the index of this register class */
+#define arch_register_class_index(cls) ((cls)->index)
+
+/** return the register class flags */
+#define arch_register_class_flags(cls) ((cls)->flags)
+
+static inline const arch_register_t *
+_arch_register_for_index(const arch_register_class_t *cls, unsigned idx)
+{
+ assert(idx < cls->n_regs);
+ return &cls->regs[idx];
+}
+
+#define arch_register_for_index(cls, idx) _arch_register_for_index(cls, idx)
+
+/**
+ * Convenience macro to check for set constraints.
+ * @param req A pointer to register requirements.
+ * @param kind The kind of constraint to check for (see arch_register_req_type_t).
+ * @return 1, If the kind of constraint is present, 0 if not.
+ */
+#define arch_register_req_is(req, kind) \
+ (((req)->type & (arch_register_req_type_ ## kind)) != 0)
+
+/**
+ * Expresses requirements to register allocation for an operand.
+ */
+struct arch_register_req_t {
+ arch_register_req_type_t type; /**< The type of the constraint. */
+ const arch_register_class_t *cls; /**< The register class this constraint belongs to. */
+
+ const unsigned *limited; /**< allowed register bitset */
+
+ unsigned other_same; /**< Bitmask of ins which should use the
+ same register (should_be_same). */
+ unsigned other_different; /**< Bitmask of ins which shall use a
+ different register
+ (must_be_different) */
+};
+
+static inline int reg_reqs_equal(const arch_register_req_t *req1,
+ const arch_register_req_t *req2)
+{
+ if (req1 == req2)
+ return 1;
+
+ if (req1->type != req2->type
+ || req1->cls != req2->cls
+ || req1->other_same != req2->other_same
+ || req1->other_different != req2->other_different)
+ return 0;
+
+ if (req1->limited != NULL) {
+ size_t n_regs;
+
+ if (req2->limited == NULL)
+ return 0;
+
+ n_regs = arch_register_class_n_regs(req1->cls);
+ if (!rbitset_equal(req1->limited, req2->limited, n_regs))
+ return 0;
+ }
+
+ return 1;
+}
+
+/**
+ * An inverse operation returned by the backend
+ */
+struct arch_inverse_t {
+ int n; /**< count of nodes returned in nodes array */
+ int costs; /**< costs of this remat */
+
+ /**< nodes for this inverse operation. shall be in
+ * schedule order. last element is the target value
+ */
+ ir_node **nodes;
+};
+
+struct arch_irn_ops_t {
+
+ /**
+ * Get the register requirements for a given operand.
+ * @param self The self pointer.
+ * @param irn The node.
+ * @param pos The operand's position (0..n for the input operands).
+ * @return The register requirements for the selected operand.
+ * The pointer returned is never NULL.
+ */
+ const arch_register_req_t *(*get_irn_reg_req)(const ir_node *irn, int pos);
+
+ /**
+ * Classify the node.
+ * @param irn The node.
+ * @return A classification.
+ */
+ arch_irn_class_t (*classify)(const ir_node *irn);
+
+ /**
+ * Get the entity on the stack frame this node depends on.
+ * @param self The this pointer.
+ * @param irn The node in question.
+ * @return The entity on the stack frame or NULL, if the node does not have a
+ * stack frame entity.
+ */
+ ir_entity *(*get_frame_entity)(const ir_node *irn);
+
+ /**
+ * Set the entity on the stack frame this node depends on.
+ * @param self The this pointer.
+ * @param irn The node in question.
+ * @param ent The entity to set
+ */
+ void (*set_frame_entity)(ir_node *irn, ir_entity *ent);
+
+ /**
+ * Set the offset of a node carrying an entity on the stack frame.
+ * @param self The this pointer.
+ * @param irn The node.
+ * @param offset The offset of the node's stack frame entity.
+ */
+ void (*set_frame_offset)(ir_node *irn, int offset);
+
+ /**
+ * Returns the delta of the stackpointer for nodes that increment or
+ * decrement the stackpointer with a constant value. (push, pop
+ * nodes on most architectures).
+ * A positive value stands for an expanding stack area, a negative value for
+ * a shrinking one.
+ *
+ * @param self The this pointer
+ * @param irn The node
+ * @return 0 if the stackpointer is not modified with a constant
+ * value, otherwise the increment/decrement value
+ */
+ int (*get_sp_bias)(const ir_node *irn);
+
+ /**
+ * Returns an inverse operation which yields the i-th argument
+ * of the given node as result.
+ *
+ * @param self The this pointer.
+ * @param irn The original operation
+ * @param i Index of the argument we want the inverse operation to yield
+ * @param inverse struct to be filled with the resulting inverse op
+ * @param obstack The obstack to use for allocation of the returned nodes array
+ * @return The inverse operation or NULL if operation invertible
+ */
+ arch_inverse_t *(*get_inverse)(const ir_node *irn, int i, arch_inverse_t *inverse, struct obstack *obstack);
+
+ /**
+ * Get the estimated cycle count for @p irn.
+ *
+ * @param self The this pointer.
+ * @param irn The node.
+ *
+ * @return The estimated cycle count for this operation
+ */
+ int (*get_op_estimated_cost)(const ir_node *irn);
+
+ /**
+ * Asks the backend whether operand @p i of @p irn can be loaded form memory internally
+ *
+ * @param self The this pointer.
+ * @param irn The node.
+ * @param i Index of the argument we would like to know whether @p irn can load it form memory internally
+ *
+ * @return nonzero if argument can be loaded or zero otherwise
+ */
+ int (*possible_memory_operand)(const ir_node *irn, unsigned int i);
+
+ /**
+ * Ask the backend to assimilate @p reload of operand @p i into @p irn.
+ *
+ * @param self The this pointer.
+ * @param irn The node.
+ * @param spill The spill.
+ * @param i The position of the reload.
+ */
+ void (*perform_memory_operand)(ir_node *irn, ir_node *spill, unsigned int i);
+};
+
+/**
+ * The code generator interface.
+ */
+struct arch_code_generator_if_t {
+ /**
+ * Initialize the code generator.
+ * @param birg A backend IRG session.
+ * @return A newly created code generator.
+ */
+ void *(*init)(be_irg_t *birg);
+
+ /**
+ * return node used as base in pic code addresses
+ */
+ ir_node* (*get_pic_base)(void *self);
+
+ /**
+ * Called before abi introduce.
+ */
+ void (*before_abi)(void *self);
+
+ /**
+ * Called, when the graph is being normalized.
+ */
+ void (*prepare_graph)(void *self);
+
+ /**
+ * Backend may provide an own spiller.
+ * This spiller needs to spill all register classes.
+ */
+ void (*spill)(void *self, be_irg_t *birg);
+
+ /**
+ * Called before register allocation.
+ */
+ void (*before_ra)(void *self);
+
+ /**
+ * Called after register allocation.
+ */
+ void (*after_ra)(void *self);
+
+ /**
+ * Called directly before done is called. This should be the last place
+ * where the irg is modified.
+ */
+ void (*finish)(void *self);
+
+ /**
+ * Called after everything happened. This call should emit the final
+ * assembly code but avoid changing the irg.
+ * The code generator must also be de-allocated here.
+ */
+ void (*done)(void *self);
+};
+
+/**
+ * helper macro: call function func from the code generator
+ * if it's implemented.
+ */
+#define _arch_cg_call(cg, func) \
+do { \
+ if((cg)->impl->func) \
+ (cg)->impl->func(cg); \
+} while(0)
+
+#define _arch_cg_call_env(cg, env, func) \
+do { \
+ if((cg)->impl->func) \
+ (cg)->impl->func(cg, env); \
+} while(0)
+
+#define arch_code_generator_before_abi(cg) _arch_cg_call(cg, before_abi)
+#define arch_code_generator_prepare_graph(cg) _arch_cg_call(cg, prepare_graph)
+#define arch_code_generator_before_ra(cg) _arch_cg_call(cg, before_ra)
+#define arch_code_generator_after_ra(cg) _arch_cg_call(cg, after_ra)
+#define arch_code_generator_finish(cg) _arch_cg_call(cg, finish)
+#define arch_code_generator_done(cg) _arch_cg_call(cg, done)
+#define arch_code_generator_spill(cg, birg) _arch_cg_call_env(cg, birg, spill)
+#define arch_code_generator_has_spiller(cg) ((cg)->impl->spill != NULL)
+#define arch_code_generator_get_pic_base(cg) \
+ ((cg)->impl->get_pic_base != NULL ? (cg)->impl->get_pic_base(cg) : NULL)
+
+/**
+ * Code generator base class.
+ */
+struct arch_code_generator_t {
+ const arch_code_generator_if_t *impl;
+};
+
+/**
+ * Architecture interface.
+ */
+struct arch_isa_if_t {
+ /**
+ * Initialize the isa interface.
+ * @param file_handle the file handle to write the output to
+ * @return a new isa instance
+ */
+ arch_env_t *(*init)(FILE *file_handle);
+
+ /**
+ * Free the isa instance.
+ */
+ void (*done)(void *self);
+
+ /**
+ * Called directly after initialization. Backend should handle all
+ * intrinsics here.
+ */
+ void (*handle_intrinsics)(void);
+
+ /**
+ * Get the the number of register classes in the isa.
+ * @return The number of register classes.
+ */
+ unsigned (*get_n_reg_class)(const void *self);
+
+ /**
+ * Get the i-th register class.
+ * @param i The number of the register class.
+ * @return The register class.
+ */
+ const arch_register_class_t *(*get_reg_class)(const void *self, unsigned i);
+
+ /**
+ * Get the register class which shall be used to store a value of a given mode.
+ * @param self The this pointer.
+ * @param mode The mode in question.
+ * @return A register class which can hold values of the given mode.
+ */
+ const arch_register_class_t *(*get_reg_class_for_mode)(const void *self, const ir_mode *mode);
+
+ /**
+ * Get the ABI restrictions for procedure calls.
+ * @param self The this pointer.
+ * @param call_type The call type of the method (procedure) in question.
+ * @param p The array of parameter locations to be filled.
+ */
+ void (*get_call_abi)(const void *self, ir_type *call_type, be_abi_call_t *abi);
+
+ /**
+ * Get the code generator interface.
+ * @param self The this pointer.
+ * @return Some code generator interface.
+ */
+ const arch_code_generator_if_t *(*get_code_generator_if)(void *self);
+
+ /**
+ * Get the list scheduler to use. There is already a selector given, the
+ * backend is free to modify and/or ignore it.
+ *
+ * @param self The isa object.
+ * @param selector The selector given by options.
+ * @return The list scheduler selector.
+ */
+ const list_sched_selector_t *(*get_list_sched_selector)(const void *self, list_sched_selector_t *selector);
+
+ /**
+ * Get the ILP scheduler to use.
+ * @param self The isa object.
+ * @return The ILP scheduler selector
+ */
+ const ilp_sched_selector_t *(*get_ilp_sched_selector)(const void *self);
+
+ /**
+ * Get the necessary alignment for storing a register of given class.
+ * @param self The isa object.
+ * @param cls The register class.
+ * @return The alignment in bytes.
+ */
+ int (*get_reg_class_alignment)(const void *self, const arch_register_class_t *cls);
+
+ /**
+ * A "static" function, returns the frontend settings
+ * needed for this backend.
+ */
+ const backend_params *(*get_params)(void);
+
+ /**
+ * Returns an 2-dim array of execution units, @p irn can be executed on.
+ * The first dimension is the type, the second the allowed units of this
+ * type.
+ * Each dimension is a NULL terminated list.
+ * @param self The isa object.
+ * @param irn The node.
+ * @return An array of allowed execution units.
+ * exec_unit = {
+ * { unit1_of_tp1, ..., unitX1_of_tp1, NULL },
+ * ...,
+ * { unit1_of_tpY, ..., unitXn_of_tpY, NULL },
+ * NULL
+ * };
+ */
+ const be_execution_unit_t ***(*get_allowed_execution_units)(const void *self, const ir_node *irn);
+
+ /**
+ * Return the abstract machine for this isa.
+ * @param self The isa object.
+ */
+ const be_machine_t *(*get_machine)(const void *self);
+
+ /**
+ * Return an ordered list of irgs where code should be generated for.
+ * If NULL is returned, all irg will be taken into account and they will be
+ * generated in an arbitrary order.
+ * @param self The isa object.
+ * @param irgs A flexible array ARR_F of length 0 where the backend can append the desired irgs.
+ * @return A flexible array ARR_F containing all desired irgs in the desired order.
+ */
+ ir_graph **(*get_backend_irg_list)(const void *self, ir_graph ***irgs);
+
+ /**
+ * mark node as rematerialized
+ */
+ void (*mark_remat)(const void *self, ir_node *node);
+
+ /**
+ * parse an assembler constraint part and set flags according to its nature
+ * advances the *c pointer to point to the last parsed character (so if you
+ * parse a single character don't advance c)
+ */
+ asm_constraint_flags_t (*parse_asm_constraint)(const void *self, const char **c);
+
+ /**
+ * returns true if the string is a valid clobbered (register) in this
+ * backend
+ */
+ int (*is_valid_clobber)(const void *self, const char *clobber);
+};
+
+#define arch_env_done(env) ((env)->impl->done(env))
+#define arch_env_handle_intrinsics(env) \
+ do { if((env)->impl->handle_intrinsics != NULL) (env)->impl->handle_intrinsics(); } while(0)
+#define arch_env_get_n_reg_class(env) ((env)->impl->get_n_reg_class(env))
+#define arch_env_get_reg_class(env,i) ((env)->impl->get_reg_class(env, i))
+#define arch_env_get_reg_class_for_mode(env,mode) ((env)->impl->get_reg_class_for_mode((env), (mode)))
+#define arch_env_get_call_abi(env,tp,abi) ((env)->impl->get_call_abi((env), (tp), (abi)))
+#define arch_env_get_code_generator_if(env) ((env)->impl->get_code_generator_if((env)))
+#define arch_env_get_list_sched_selector(env,selector) ((env)->impl->get_list_sched_selector((env), (selector)))
+#define arch_env_get_ilp_sched_selector(env) ((env)->impl->get_ilp_sched_selector(env))
+#define arch_env_get_reg_class_alignment(env,cls) ((env)->impl->get_reg_class_alignment((env), (cls)))
+#define arch_env_get_params(env) ((env)->impl->get_params())
+#define arch_env_get_allowed_execution_units(env,irn) ((env)->impl->get_allowed_execution_units((env), (irn)))
+#define arch_env_get_machine(env) ((env)->impl->get_machine(env))
+#define arch_env_get_backend_irg_list(env,irgs) ((env)->impl->get_backend_irg_list((env), (irgs)))
+#define arch_env_parse_asm_constraint(env,c) ((env)->impl->parse_asm_constraint((env), (c))
+#define arch_env_is_valid_clobber(env,clobber) ((env)->impl->is_valid_clobber((env), (clobber))
+#define arch_env_mark_remat(env,node) \
+ do { if ((env)->impl->mark_remat != NULL) (env)->impl->mark_remat((env), (node)); } while(0)
+
+/**
+ * ISA base class.
+ */
+struct arch_env_t {
+ const arch_isa_if_t *impl;
+ const arch_register_t *sp; /** The stack pointer register. */
+ const arch_register_t *bp; /** The base pointer register. */
+ const arch_register_class_t *link_class; /** The static link pointer register class. */
+ int stack_dir; /** -1 for decreasing, 1 for increasing. */
+ int stack_alignment; /** power of 2 stack alignment */
+ const be_main_env_t *main_env; /** the be main environment */
+ int spill_cost; /** cost for a be_Spill node */
+ int reload_cost; /** cost for a be_Reload node */
+};
+
+static inline unsigned arch_irn_get_n_outs(const ir_node *node)
+{
+ backend_info_t *info = be_get_info(node);
+ return ARR_LEN(info->out_infos);
+}
+
+static inline bool arch_irn_consider_in_reg_alloc(
+ const arch_register_class_t *cls, const ir_node *node)
+{
+ const arch_register_req_t *req = arch_get_register_req_out(node);
+ return
+ req->cls == cls &&
+ !(req->type & arch_register_req_type_ignore);
+}
+
+static inline bool arch_irn_is_ignore(const ir_node *irn)
+{
+ const arch_register_req_t *req = arch_get_register_req_out(irn);
+ return !!(req->type & arch_register_req_type_ignore);
+}
+
#endif /* FIRM_BE_BEARCH_H */
+++ /dev/null
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief Processor architecture specification - internal data structures.
- * @author Sebastian Hack
- * @version $Id$
- */
-#ifndef FIRM_BE_BEARCH_T_H
-#define FIRM_BE_BEARCH_T_H
-
-#include "bearch.h"
-
-#include "belistsched.h"
-#include "beilpsched.h"
-#include "bemachine.h"
-#include "beirg.h"
-#include "beinfo.h"
-#include "beabi.h"
-#include "raw_bitset.h"
-
-/**
- * A register.
- */
-struct arch_register_t {
- const char *name; /**< The name of the register. */
- const arch_register_class_t *reg_class; /**< The class the register belongs to. */
- unsigned index; /**< The index of the register in the class. */
- arch_register_type_t type; /**< The type of the register. */
-};
-
-static inline const arch_register_class_t *
-_arch_register_get_class(const arch_register_t *reg)
-{
- return reg->reg_class;
-}
-
-static inline
-unsigned _arch_register_get_index(const arch_register_t *reg)
-{
- return reg->index;
-}
-
-static inline
-const char *_arch_register_get_name(const arch_register_t *reg)
-{
- return reg->name;
-}
-
-#define arch_register_get_class(reg) _arch_register_get_class(reg)
-#define arch_register_get_index(reg) _arch_register_get_index(reg)
-#define arch_register_get_name(reg) _arch_register_get_name(reg)
-
-/**
- * Convenience macro to check for register type.
- * @param req A pointer to register.
- * @param kind The kind of type to check for (see arch_register_type_t).
- * @return 1, If register is of given kind, 0 if not.
- */
-#define arch_register_type_is(reg, kind) \
- (((reg)->type & arch_register_type_ ## kind) != 0)
-
-/**
- * A class of registers.
- * Like general purpose or floating point.
- */
-struct arch_register_class_t {
- unsigned index; /**< index of this register class */
- const char *name; /**< The name of the register class.*/
- unsigned n_regs; /**< Number of registers in this
- class. */
- ir_mode *mode; /**< The mode of the register class.*/
- const arch_register_t *regs; /**< The array of registers. */
- arch_register_class_flags_t flags; /**< register class flags. */
-};
-
-/** return the number of registers in this register class */
-#define arch_register_class_n_regs(cls) ((cls)->n_regs)
-
-/** return the largest mode of this register class */
-#define arch_register_class_mode(cls) ((cls)->mode)
-
-/** return the name of this register class */
-#define arch_register_class_name(cls) ((cls)->name)
-
-/** return the index of this register class */
-#define arch_register_class_index(cls) ((cls)->index)
-
-/** return the register class flags */
-#define arch_register_class_flags(cls) ((cls)->flags)
-
-static inline const arch_register_t *
-_arch_register_for_index(const arch_register_class_t *cls, unsigned idx)
-{
- assert(idx < cls->n_regs);
- return &cls->regs[idx];
-}
-
-#define arch_register_for_index(cls, idx) _arch_register_for_index(cls, idx)
-
-/**
- * Convenience macro to check for set constraints.
- * @param req A pointer to register requirements.
- * @param kind The kind of constraint to check for (see arch_register_req_type_t).
- * @return 1, If the kind of constraint is present, 0 if not.
- */
-#define arch_register_req_is(req, kind) \
- (((req)->type & (arch_register_req_type_ ## kind)) != 0)
-
-/**
- * Expresses requirements to register allocation for an operand.
- */
-struct arch_register_req_t {
- arch_register_req_type_t type; /**< The type of the constraint. */
- const arch_register_class_t *cls; /**< The register class this constraint belongs to. */
-
- const unsigned *limited; /**< allowed register bitset */
-
- unsigned other_same; /**< Bitmask of ins which should use the
- same register (should_be_same). */
- unsigned other_different; /**< Bitmask of ins which shall use a
- different register
- (must_be_different) */
-};
-
-static inline int reg_reqs_equal(const arch_register_req_t *req1,
- const arch_register_req_t *req2)
-{
- if (req1 == req2)
- return 1;
-
- if (req1->type != req2->type
- || req1->cls != req2->cls
- || req1->other_same != req2->other_same
- || req1->other_different != req2->other_different)
- return 0;
-
- if (req1->limited != NULL) {
- size_t n_regs;
-
- if (req2->limited == NULL)
- return 0;
-
- n_regs = arch_register_class_n_regs(req1->cls);
- if (!rbitset_equal(req1->limited, req2->limited, n_regs))
- return 0;
- }
-
- return 1;
-}
-
-/**
- * An inverse operation returned by the backend
- */
-struct arch_inverse_t {
- int n; /**< count of nodes returned in nodes array */
- int costs; /**< costs of this remat */
-
- /**< nodes for this inverse operation. shall be in
- * schedule order. last element is the target value
- */
- ir_node **nodes;
-};
-
-struct arch_irn_ops_t {
-
- /**
- * Get the register requirements for a given operand.
- * @param self The self pointer.
- * @param irn The node.
- * @param pos The operand's position (0..n for the input operands).
- * @return The register requirements for the selected operand.
- * The pointer returned is never NULL.
- */
- const arch_register_req_t *(*get_irn_reg_req)(const ir_node *irn, int pos);
-
- /**
- * Classify the node.
- * @param irn The node.
- * @return A classification.
- */
- arch_irn_class_t (*classify)(const ir_node *irn);
-
- /**
- * Get the entity on the stack frame this node depends on.
- * @param self The this pointer.
- * @param irn The node in question.
- * @return The entity on the stack frame or NULL, if the node does not have a
- * stack frame entity.
- */
- ir_entity *(*get_frame_entity)(const ir_node *irn);
-
- /**
- * Set the entity on the stack frame this node depends on.
- * @param self The this pointer.
- * @param irn The node in question.
- * @param ent The entity to set
- */
- void (*set_frame_entity)(ir_node *irn, ir_entity *ent);
-
- /**
- * Set the offset of a node carrying an entity on the stack frame.
- * @param self The this pointer.
- * @param irn The node.
- * @param offset The offset of the node's stack frame entity.
- */
- void (*set_frame_offset)(ir_node *irn, int offset);
-
- /**
- * Returns the delta of the stackpointer for nodes that increment or
- * decrement the stackpointer with a constant value. (push, pop
- * nodes on most architectures).
- * A positive value stands for an expanding stack area, a negative value for
- * a shrinking one.
- *
- * @param self The this pointer
- * @param irn The node
- * @return 0 if the stackpointer is not modified with a constant
- * value, otherwise the increment/decrement value
- */
- int (*get_sp_bias)(const ir_node *irn);
-
- /**
- * Returns an inverse operation which yields the i-th argument
- * of the given node as result.
- *
- * @param self The this pointer.
- * @param irn The original operation
- * @param i Index of the argument we want the inverse operation to yield
- * @param inverse struct to be filled with the resulting inverse op
- * @param obstack The obstack to use for allocation of the returned nodes array
- * @return The inverse operation or NULL if operation invertible
- */
- arch_inverse_t *(*get_inverse)(const ir_node *irn, int i, arch_inverse_t *inverse, struct obstack *obstack);
-
- /**
- * Get the estimated cycle count for @p irn.
- *
- * @param self The this pointer.
- * @param irn The node.
- *
- * @return The estimated cycle count for this operation
- */
- int (*get_op_estimated_cost)(const ir_node *irn);
-
- /**
- * Asks the backend whether operand @p i of @p irn can be loaded form memory internally
- *
- * @param self The this pointer.
- * @param irn The node.
- * @param i Index of the argument we would like to know whether @p irn can load it form memory internally
- *
- * @return nonzero if argument can be loaded or zero otherwise
- */
- int (*possible_memory_operand)(const ir_node *irn, unsigned int i);
-
- /**
- * Ask the backend to assimilate @p reload of operand @p i into @p irn.
- *
- * @param self The this pointer.
- * @param irn The node.
- * @param spill The spill.
- * @param i The position of the reload.
- */
- void (*perform_memory_operand)(ir_node *irn, ir_node *spill, unsigned int i);
-};
-
-/**
- * The code generator interface.
- */
-struct arch_code_generator_if_t {
- /**
- * Initialize the code generator.
- * @param birg A backend IRG session.
- * @return A newly created code generator.
- */
- void *(*init)(be_irg_t *birg);
-
- /**
- * return node used as base in pic code addresses
- */
- ir_node* (*get_pic_base)(void *self);
-
- /**
- * Called before abi introduce.
- */
- void (*before_abi)(void *self);
-
- /**
- * Called, when the graph is being normalized.
- */
- void (*prepare_graph)(void *self);
-
- /**
- * Backend may provide an own spiller.
- * This spiller needs to spill all register classes.
- */
- void (*spill)(void *self, be_irg_t *birg);
-
- /**
- * Called before register allocation.
- */
- void (*before_ra)(void *self);
-
- /**
- * Called after register allocation.
- */
- void (*after_ra)(void *self);
-
- /**
- * Called directly before done is called. This should be the last place
- * where the irg is modified.
- */
- void (*finish)(void *self);
-
- /**
- * Called after everything happened. This call should emit the final
- * assembly code but avoid changing the irg.
- * The code generator must also be de-allocated here.
- */
- void (*done)(void *self);
-};
-
-/**
- * helper macro: call function func from the code generator
- * if it's implemented.
- */
-#define _arch_cg_call(cg, func) \
-do { \
- if((cg)->impl->func) \
- (cg)->impl->func(cg); \
-} while(0)
-
-#define _arch_cg_call_env(cg, env, func) \
-do { \
- if((cg)->impl->func) \
- (cg)->impl->func(cg, env); \
-} while(0)
-
-#define arch_code_generator_before_abi(cg) _arch_cg_call(cg, before_abi)
-#define arch_code_generator_prepare_graph(cg) _arch_cg_call(cg, prepare_graph)
-#define arch_code_generator_before_ra(cg) _arch_cg_call(cg, before_ra)
-#define arch_code_generator_after_ra(cg) _arch_cg_call(cg, after_ra)
-#define arch_code_generator_finish(cg) _arch_cg_call(cg, finish)
-#define arch_code_generator_done(cg) _arch_cg_call(cg, done)
-#define arch_code_generator_spill(cg, birg) _arch_cg_call_env(cg, birg, spill)
-#define arch_code_generator_has_spiller(cg) ((cg)->impl->spill != NULL)
-#define arch_code_generator_get_pic_base(cg) \
- ((cg)->impl->get_pic_base != NULL ? (cg)->impl->get_pic_base(cg) : NULL)
-
-/**
- * Code generator base class.
- */
-struct arch_code_generator_t {
- const arch_code_generator_if_t *impl;
-};
-
-/**
- * Architecture interface.
- */
-struct arch_isa_if_t {
- /**
- * Initialize the isa interface.
- * @param file_handle the file handle to write the output to
- * @return a new isa instance
- */
- arch_env_t *(*init)(FILE *file_handle);
-
- /**
- * Free the isa instance.
- */
- void (*done)(void *self);
-
- /**
- * Called directly after initialization. Backend should handle all
- * intrinsics here.
- */
- void (*handle_intrinsics)(void);
-
- /**
- * Get the the number of register classes in the isa.
- * @return The number of register classes.
- */
- unsigned (*get_n_reg_class)(const void *self);
-
- /**
- * Get the i-th register class.
- * @param i The number of the register class.
- * @return The register class.
- */
- const arch_register_class_t *(*get_reg_class)(const void *self, unsigned i);
-
- /**
- * Get the register class which shall be used to store a value of a given mode.
- * @param self The this pointer.
- * @param mode The mode in question.
- * @return A register class which can hold values of the given mode.
- */
- const arch_register_class_t *(*get_reg_class_for_mode)(const void *self, const ir_mode *mode);
-
- /**
- * Get the ABI restrictions for procedure calls.
- * @param self The this pointer.
- * @param call_type The call type of the method (procedure) in question.
- * @param p The array of parameter locations to be filled.
- */
- void (*get_call_abi)(const void *self, ir_type *call_type, be_abi_call_t *abi);
-
- /**
- * Get the code generator interface.
- * @param self The this pointer.
- * @return Some code generator interface.
- */
- const arch_code_generator_if_t *(*get_code_generator_if)(void *self);
-
- /**
- * Get the list scheduler to use. There is already a selector given, the
- * backend is free to modify and/or ignore it.
- *
- * @param self The isa object.
- * @param selector The selector given by options.
- * @return The list scheduler selector.
- */
- const list_sched_selector_t *(*get_list_sched_selector)(const void *self, list_sched_selector_t *selector);
-
- /**
- * Get the ILP scheduler to use.
- * @param self The isa object.
- * @return The ILP scheduler selector
- */
- const ilp_sched_selector_t *(*get_ilp_sched_selector)(const void *self);
-
- /**
- * Get the necessary alignment for storing a register of given class.
- * @param self The isa object.
- * @param cls The register class.
- * @return The alignment in bytes.
- */
- int (*get_reg_class_alignment)(const void *self, const arch_register_class_t *cls);
-
- /**
- * A "static" function, returns the frontend settings
- * needed for this backend.
- */
- const backend_params *(*get_params)(void);
-
- /**
- * Returns an 2-dim array of execution units, @p irn can be executed on.
- * The first dimension is the type, the second the allowed units of this
- * type.
- * Each dimension is a NULL terminated list.
- * @param self The isa object.
- * @param irn The node.
- * @return An array of allowed execution units.
- * exec_unit = {
- * { unit1_of_tp1, ..., unitX1_of_tp1, NULL },
- * ...,
- * { unit1_of_tpY, ..., unitXn_of_tpY, NULL },
- * NULL
- * };
- */
- const be_execution_unit_t ***(*get_allowed_execution_units)(const void *self, const ir_node *irn);
-
- /**
- * Return the abstract machine for this isa.
- * @param self The isa object.
- */
- const be_machine_t *(*get_machine)(const void *self);
-
- /**
- * Return an ordered list of irgs where code should be generated for.
- * If NULL is returned, all irg will be taken into account and they will be
- * generated in an arbitrary order.
- * @param self The isa object.
- * @param irgs A flexible array ARR_F of length 0 where the backend can append the desired irgs.
- * @return A flexible array ARR_F containing all desired irgs in the desired order.
- */
- ir_graph **(*get_backend_irg_list)(const void *self, ir_graph ***irgs);
-
- /**
- * mark node as rematerialized
- */
- void (*mark_remat)(const void *self, ir_node *node);
-
- /**
- * parse an assembler constraint part and set flags according to its nature
- * advances the *c pointer to point to the last parsed character (so if you
- * parse a single character don't advance c)
- */
- asm_constraint_flags_t (*parse_asm_constraint)(const void *self, const char **c);
-
- /**
- * returns true if the string is a valid clobbered (register) in this
- * backend
- */
- int (*is_valid_clobber)(const void *self, const char *clobber);
-};
-
-#define arch_env_done(env) ((env)->impl->done(env))
-#define arch_env_handle_intrinsics(env) \
- do { if((env)->impl->handle_intrinsics != NULL) (env)->impl->handle_intrinsics(); } while(0)
-#define arch_env_get_n_reg_class(env) ((env)->impl->get_n_reg_class(env))
-#define arch_env_get_reg_class(env,i) ((env)->impl->get_reg_class(env, i))
-#define arch_env_get_reg_class_for_mode(env,mode) ((env)->impl->get_reg_class_for_mode((env), (mode)))
-#define arch_env_get_call_abi(env,tp,abi) ((env)->impl->get_call_abi((env), (tp), (abi)))
-#define arch_env_get_code_generator_if(env) ((env)->impl->get_code_generator_if((env)))
-#define arch_env_get_list_sched_selector(env,selector) ((env)->impl->get_list_sched_selector((env), (selector)))
-#define arch_env_get_ilp_sched_selector(env) ((env)->impl->get_ilp_sched_selector(env))
-#define arch_env_get_reg_class_alignment(env,cls) ((env)->impl->get_reg_class_alignment((env), (cls)))
-#define arch_env_get_params(env) ((env)->impl->get_params())
-#define arch_env_get_allowed_execution_units(env,irn) ((env)->impl->get_allowed_execution_units((env), (irn)))
-#define arch_env_get_machine(env) ((env)->impl->get_machine(env))
-#define arch_env_get_backend_irg_list(env,irgs) ((env)->impl->get_backend_irg_list((env), (irgs)))
-#define arch_env_parse_asm_constraint(env,c) ((env)->impl->parse_asm_constraint((env), (c))
-#define arch_env_is_valid_clobber(env,clobber) ((env)->impl->is_valid_clobber((env), (clobber))
-#define arch_env_mark_remat(env,node) \
- do { if ((env)->impl->mark_remat != NULL) (env)->impl->mark_remat((env), (node)); } while(0)
-
-/**
- * ISA base class.
- */
-struct arch_env_t {
- const arch_isa_if_t *impl;
- const arch_register_t *sp; /** The stack pointer register. */
- const arch_register_t *bp; /** The base pointer register. */
- const arch_register_class_t *link_class; /** The static link pointer register class. */
- int stack_dir; /** -1 for decreasing, 1 for increasing. */
- int stack_alignment; /** power of 2 stack alignment */
- const be_main_env_t *main_env; /** the be main environment */
- int spill_cost; /** cost for a be_Spill node */
- int reload_cost; /** cost for a be_Reload node */
-};
-
-static inline unsigned arch_irn_get_n_outs(const ir_node *node)
-{
- backend_info_t *info = be_get_info(node);
- return ARR_LEN(info->out_infos);
-}
-
-static inline bool arch_irn_consider_in_reg_alloc(
- const arch_register_class_t *cls, const ir_node *node)
-{
- const arch_register_req_t *req = arch_get_register_req_out(node);
- return
- req->cls == cls &&
- !(req->type & arch_register_req_type_ignore);
-}
-
-static inline bool arch_irn_is_ignore(const ir_node *irn)
-{
- const arch_register_req_t *req = arch_get_register_req_out(irn);
- return !!(req->type & arch_register_req_type_ignore);
-}
-
-#endif
#include "beutil.h"
#include "besched.h"
-#include "besched_t.h"
+#include "besched.h"
#include "belive_t.h"
#include "benode_t.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "beirgmod.h"
#include "beifg.h"
#include "beinsn_t.h"
#include "bestatevent.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "beintlive_t.h"
#include "bera.h"
#include "bechordal_t.h"
#include "belive_t.h"
#include "bechordal_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "bechordal_draw.h"
-#include "beirg_t.h"
+#include "beirg.h"
typedef struct {
be_chordal_env_t *env;
#include "beabi.h"
#include "beutil.h"
#include "besched.h"
-#include "besched_t.h"
+#include "besched.h"
#include "belive_t.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "beifg_t.h"
#include "beifg_impl.h"
#include "benode_t.h"
#include "bemodule.h"
#include "be_t.h"
#include "bera.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "bespillslots.h"
#include "bespilloptions.h"
#include "becopyopt_t.h"
#include "becopystat.h"
#include "beintlive_t.h"
-#include "beirg_t.h"
+#include "beirg.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
#include "becopyopt.h"
#include "becopyopt_t.h"
#include "bechordal_t.h"
-#include "beirg_t.h"
+#include "beirg.h"
#define DUMP_BEFORE 1
#define DUMP_AFTER 2
#include "irprintf.h"
#include "bestatevent.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "bemodule.h"
#include "error.h"
#include "irgwalk.h"
#include "becopyilp_t.h"
#include "beifg_t.h"
-#include "besched_t.h"
+#include "besched.h"
#define DEBUG_LVL 1
#include "irprintf_t.h"
#include "bemodule.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "benode_t.h"
#include "beutil.h"
#include "beifg_t.h"
#include "becopystat.h"
#include "belive_t.h"
#include "beinsn_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "bestatevent.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "error.h"
#include "lc_opts.h"
#include "set.h"
#include "irnode_t.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "bechordal_t.h"
#include "becopyopt.h"
#include "beutil.h"
#include "becopyopt_t.h"
#include "becopystat.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "bemodule.h"
#include "beintlive_t.h"
#define FIRM_BE_BECOPYSTAT_H
#include "firm_types.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "bechordal_t.h"
void copystat_add_max_costs(int costs);
#define FIRM_BE_BEDOMFRONT_H
#include "firm_types.h"
-
-/*
- * Forward type declaration.
- */
-typedef struct _be_dom_front_info_t be_dom_front_info_t;
+#include "be_types.h"
/**
* Compute the dominance frontiers for a given graph.
#include "error.h"
#include "beflags.h"
-#include "bearch_t.h"
-#include "beirg_t.h"
-#include "besched_t.h"
+#include "bearch.h"
+#include "beirg.h"
+#include "besched.h"
#include "benode_t.h"
+#include "belive.h"
static const arch_register_class_t *flag_class = NULL;
static const arch_register_t *flags_reg = NULL;
#include "becopystat.h"
#include "becopyopt.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "bemodule.h"
/** Defines values for the ifg performance test */
#include "irgwalk.h"
#include "irbitset.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "be_t.h"
#include "beintlive_t.h"
#include "beifg_t.h"
#include "irgraph_t.h"
#include "irgwalk.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "be_t.h"
#include "bera.h"
#include "beifg_t.h"
#include "irgwalk.h"
#include "irtools.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "be_t.h"
#include "belive_t.h"
#include "bera.h"
#include "beifg_t.h"
#include "bechordal_t.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "beintlive_t.h"
typedef struct _ifg_std_t ifg_std_t;
#include "be.h"
#include "benode_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "beilpsched.h"
#include "beutil.h"
#include "bestat.h"
-#include "beirg_t.h"
+#include "beirg.h"
+#include "bemachine.h"
+#include "belistsched.h"
typedef struct _ilpsched_options_t {
unsigned regpress;
#include "irgraph.h"
#include "irnode.h"
-
-typedef struct _ilp_sched_selector_t ilp_sched_selector_t;
-typedef struct _ilp_sched_selector_if_t ilp_sched_selector_if_t;
+#include "be_types.h"
/**
* A selector interface which is used by the ILP schedule framework.
#include "config.h"
#include "beinfo.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "irgwalk.h"
#include "irnode_t.h"
#include "error.h"
#ifndef FIRM_BE_BEINFO_H
#define FIRM_BE_BEINFO_H
-#include "bearch.h"
-#include "irphase_t.h"
-#include "irphases_t.h"
-
-typedef unsigned int sched_timestep_t;
+#include "be_types.h"
+#include "irnode_t.h"
/**
* The schedule structure which is present at each ir node.
* Currently, only basic blocks are scheduled. The list head of
* every block schedule list is the Block list.
*/
-typedef struct sched_info_t {
+struct sched_info_t {
ir_node *next;
ir_node *prev;
sched_timestep_t time_step; /**< If a is after b in a schedule, its time step is larger than b's. */
-} sched_info_t;
+};
-typedef struct reg_out_info_t {
+struct reg_out_info_t {
const arch_register_t *reg;
const arch_register_req_t *req;
-} reg_out_info_t;
+};
-typedef struct backend_info_t {
+struct backend_info_t {
sched_info_t sched_info;
const arch_register_req_t **in_reqs;
reg_out_info_t *out_infos;
arch_irn_flags_t flags;
-} backend_info_t;
+};
static inline backend_info_t *be_get_info(const ir_node *node)
{
#include "irnode_t.h"
#include "iredges.h"
-#include "besched_t.h"
+#include "besched.h"
#include "beinsn_t.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "beabi.h"
#include "raw_bitset.h"
#include "statev.h"
-#include "beirg_t.h"
-#include "besched_t.h"
+#include "beirg.h"
+#include "besched.h"
#include "belive_t.h"
/**
#include "config.h"
#include "execfreq.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "absgraph.h"
+#include "belive.h"
+#include "bedomfront.h"
be_lv_t *be_assure_liveness(be_irg_t *birg)
{
birg->lv = NULL;
}
}
-
-ir_graph *(be_get_birg_irg)(const be_irg_t *birg)
-{
- return _be_get_birg_irg(birg);
-}
-
-ir_exec_freq *(be_get_birg_exec_freq)(const be_irg_t *birg)
-{
- return _be_get_birg_exec_freq(birg);
-}
-
-be_lv_t *(be_get_birg_liveness)(const be_irg_t *birg)
-{
- return _be_get_birg_liveness(birg);
-}
-
-be_dom_front_info_t *(be_get_birg_dom_front)(const be_irg_t *birg)
-{
- return _be_get_birg_dom_front(birg);
-}
-
-const arch_env_t *(be_get_birg_arch_env)(const be_irg_t *birg)
-{
- return _be_get_birg_arch_env(birg);
-}
#ifndef FIRM_BE_BEIRG_H
#define FIRM_BE_BEIRG_H
-#include "belive.h"
-#include "bedomfront.h"
-
-typedef struct be_irg_t be_irg_t;
-
-ir_graph *be_get_birg_irg(const be_irg_t *birg);
+#include "be.h"
+#include "be_types.h"
+#include "be_t.h"
be_lv_t *be_assure_liveness(be_irg_t *birg);
-be_lv_t *be_get_birg_liveness(const be_irg_t *birg);
void be_assure_dom_front(be_irg_t *birg);
void be_invalidate_dom_front(be_irg_t *birg);
-be_dom_front_info_t *be_get_birg_dom_front(const be_irg_t *birg);
-
-const arch_env_t *be_get_birg_arch_env(const be_irg_t *birg);
-
-ir_exec_freq *be_get_birg_exec_freq(const be_irg_t *birg);
/**
* frees all memory allocated by birg structures (liveness, dom_front, ...).
*/
void be_free_birg(be_irg_t *birg);
+/**
+ * An ir_graph with additional analysis data about this irg. Also includes some
+ * backend structures
+ */
+struct be_irg_t {
+ ir_graph *irg;
+ be_main_env_t *main_env;
+ be_abi_irg_t *abi;
+ arch_code_generator_t *cg;
+ ir_exec_freq *exec_freq;
+ be_dom_front_info_t *dom_front;
+ be_lv_t *lv;
+};
+
+static inline be_lv_t *
+be_get_birg_liveness(const be_irg_t *birg) {
+ return birg->lv;
+}
+
+static inline ir_exec_freq *
+be_get_birg_exec_freq(const be_irg_t *birg) {
+ return birg->exec_freq;
+}
+
+static inline be_dom_front_info_t *
+be_get_birg_dom_front(const be_irg_t *birg) {
+ return birg->dom_front;
+}
+
+static inline ir_graph *
+be_get_birg_irg(const be_irg_t *birg) {
+ return birg->irg;
+}
+
+static inline const arch_env_t *
+be_get_birg_arch_env(const be_irg_t *birg) {
+ return birg->main_env->arch_env;
+}
+
#endif /* FIRM_BE_BEIRG_H */
+++ /dev/null
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief Backend irg - a ir_graph with additional analysis information.
- * @author Matthias Braun
- * @date 05.05.2006
- * @version $Id$
- */
-#ifndef FIRM_BE_BEIRG_T_H
-#define FIRM_BE_BEIRG_T_H
-
-#include "beirg.h"
-#include "be_t.h"
-#include "beabi.h"
-#include "irlivechk.h"
-
-/**
- * An ir_graph with additional analysis data about this irg. Also includes some
- * backend structures
- */
-struct be_irg_t {
- ir_graph *irg;
- be_main_env_t *main_env;
- be_abi_irg_t *abi;
- arch_code_generator_t *cg;
- ir_exec_freq *exec_freq;
- be_dom_front_info_t *dom_front;
- be_lv_t *lv;
-};
-
-static inline be_lv_t *
-_be_get_birg_liveness(const be_irg_t *birg) {
- return birg->lv;
-}
-
-static inline ir_exec_freq *
-_be_get_birg_exec_freq(const be_irg_t *birg) {
- return birg->exec_freq;
-}
-
-static inline be_dom_front_info_t *
-_be_get_birg_dom_front(const be_irg_t *birg) {
- return birg->dom_front;
-}
-
-static inline ir_graph *
-_be_get_birg_irg(const be_irg_t *birg) {
- return birg->irg;
-}
-
-static inline const arch_env_t *
-_be_get_birg_arch_env(const be_irg_t *birg) {
- return birg->main_env->arch_env;
-}
-
-#define be_get_birg_exec_freq(birg) _be_get_birg_exec_freq(birg)
-#define be_get_birg_liveness(birg) _be_get_birg_liveness(birg)
-#define be_get_birg_dom_front(birg) _be_get_birg_dom_front(birg)
-#define be_get_birg_irg(birg) _be_get_birg_irg(birg)
-
-#endif /* FIRM_BE_BEIRG_T_H */
#include "be_t.h"
#include "bechordal_t.h"
-#include "bearch_t.h"
-#include "besched_t.h"
+#include "bearch.h"
+#include "besched.h"
#include "belive_t.h"
#include "benode_t.h"
#include "beutil.h"
#include "beinsn_t.h"
#include "bessaconstr.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "beirgmod.h"
#include "bemodule.h"
#include "irtools.h"
#include "bemodule.h"
-#include "besched_t.h"
+#include "besched.h"
#include "beutil.h"
#include "belive_t.h"
#include "belistsched.h"
#include "beschedmris.h"
#include "beschedrss.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "bestat.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "lc_opts.h"
#include "lc_opts_enum.h"
#include "irnodeset.h"
#include "be.h"
+#include "be_types.h"
#include "bearch.h"
#include "beirg.h"
-typedef struct _list_sched_selector_t list_sched_selector_t;
-
/**
* A selector interface which is used by the list schedule framework.
* You can implement your own list scheduler by implementing these
#include "beutil.h"
#include "belive_t.h"
-#include "beirg_t.h"
-#include "besched_t.h"
+#include "beirg.h"
+#include "besched.h"
#include "bemodule.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
#include <stdio.h>
+#include "be_types.h"
+
#include "firm_types.h"
#include "pset.h"
be_lv_state_out = 4,
} be_lv_state_t;
-typedef struct _be_lv_t be_lv_t;
-
-typedef struct _be_lv_info_t be_lv_info_t;
-
/**
* Compute the inter block liveness for a graph.
* @param irg The graph.
#include "error.h"
#include "debug.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "belive.h"
#include "besched.h"
#include "beloopana.h"
#include "irgwalk.h"
#include "array_t.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "belower.h"
#include "benode_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "bestat.h"
#include "bessaconstr.h"
#include "beintlive_t.h"
#ifndef FIRM_BE_BEMACHINE_H
#define FIRM_BE_BEMACHINE_H
-typedef struct _be_execution_unit_type_t be_execution_unit_type_t;
-typedef struct _be_execution_unit_t be_execution_unit_t;
-typedef struct _be_machine_t be_machine_t;
+#include "be_types.h"
struct _be_execution_unit_t {
be_execution_unit_type_t *tp;
#include "execfreq.h"
#include "irprofile.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "be_t.h"
#include "bemodule.h"
#include "beutil.h"
#include "benode_t.h"
#include "beirgmod.h"
-#include "besched_t.h"
+#include "besched.h"
#include "belistsched.h"
#include "belive_t.h"
#include "bera.h"
#include "bestat.h"
#include "beverify.h"
#include "be_dbgout.h"
-#include "beirg_t.h"
+#include "beirg.h"
#define NEW_ID(s) new_id_from_chars(s, sizeof(s) - 1)
* add copies and split live-ranges.
*
* TODO:
+ * - make use of free registers in the permutate_values code
* - output constraints are not ensured. The algorithm fails to copy values
* away, so the registers for constrained outputs are free.
* - must_be_different constraint is not respected
- * - No parallel copies at basic block borders are created, no additional phis
- * created after copies have been inserted.
+ * - We have to pessimistically construct Phi_0s when not all predecessors
+ * of a block are known.
* - Phi color assignment should give bonus points towards registers already
* assigned at predecessors.
* - think about a smarter sequence of visiting the blocks. Sorted by
#include "belive_t.h"
#include "bemodule.h"
#include "bechordal_t.h"
-#include "besched_t.h"
-#include "beirg_t.h"
+#include "besched.h"
+#include "beirg.h"
#include "benode_t.h"
#include "bespill.h"
#include "bespilloptions.h"
unsigned r = reg_prefs[i].num;
/* ignores should be last and we should have a non-ignore left */
assert(!bitset_is_set(ignore_regs, r));
- /* already used? TODO: It might be better to copy the value occupying the register around here, find out when... */
+ /* already used?
+ TODO: It might be better to copy the value occupying the register around here, find out when... */
if (assignments[r].value != NULL)
continue;
reg = arch_register_for_index(cls, r);
/* assign regs for live-in values */
foreach_ir_nodeset(&live_nodes, node, iter) {
- const arch_register_t *reg;
- reg = arch_get_irn_register(node);
+ const arch_register_t *reg = arch_get_irn_register(node);
if (reg != NULL)
continue;
}
}
+ /* free registers of values last used at this instruction */
free_last_uses(&live_nodes, node);
/* assign output registers */
bitset_free(ignore_regs);
- /* TODO: dump intermediate results */
-
stat_ev_ctx_pop("bestraight_cls");
}
+ BE_TIMER_PUSH(t_verify);
+ if (birg->main_env->options->vrfy_option == BE_CH_VRFY_WARN) {
+ be_verify_register_allocation(birg);
+ } else if(birg->main_env->options->vrfy_option == BE_CH_VRFY_ASSERT) {
+ assert(be_verify_register_allocation(birg)
+ && "Register allocation invalid");
+ }
+ BE_TIMER_POP(t_verify);
+
obstack_free(&obst, NULL);
}
#include "be_t.h"
#include "belive_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "benode_t.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "beirgmod.h"
#include "irgmod.h"
#include "error.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "belive_t.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "benode_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "bemodule.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
#define BEPEEPHOLE_H
#include "beirg.h"
-#include "bearch_t.h"
+#include "bearch.h"
extern ir_node ***register_values;
#include "be_t.h"
#include "belive_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "beirgmod.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "benode_t.h"
#include "beutil.h"
#include "bespill.h"
-#include "beirg_t.h"
+#include "beirg.h"
#define MAXPRESSURE 128
#include "bera.h"
#include "beutil.h"
-#include "besched_t.h"
+#include "besched.h"
#include "belive_t.h"
#include "bemodule.h"
#include "debug.h"
#include "bemodule.h"
-#include "bearch_t.h"
-#include "besched_t.h"
+#include "bearch.h"
+#include "besched.h"
#include "beutil.h"
#include "belistsched.h"
+#include "belive.h"
FIRM_IMPL1(have_sched_info, int, const ir_graph *)
FIRM_IMPL1(sched_get_time_step, int, const ir_node *)
#include "irgraph.h"
#include "irnode.h"
#include "beirg.h"
+#include "beinfo.h"
+#include "beutil.h"
void be_sched_dump(FILE *f, ir_graph *irg);
*/
void be_remove_dead_nodes_from_schedule(be_irg_t *birg);
+#define SCHED_INITIAL_GRANULARITY (1 << 14)
+#define get_irn_sched_info(irn) (&be_get_info(skip_Proj_const(irn))->sched_info)
+
+/**
+ * Returns non-zero if schedule information is available
+ * for a given graph.
+ * @param irg The graph.
+ */
+static inline int _have_sched_info(const ir_graph *irg)
+{
+ return be_info_initialized(irg);
+}
+
+/**
+ * Check, if the node is scheduled.
+ * @param irn The node.
+ * @return 1, if the node is scheduled, 0 if not.
+ */
+static inline int _sched_is_scheduled(const ir_node *irn)
+{
+ return get_irn_sched_info(irn)->next != NULL;
+}
+
+/**
+ * Get the time step of an irn in a schedule.
+ * @param irn The node.
+ * @return The time step in the schedule.
+ */
+static inline int _sched_get_time_step(const ir_node *irn)
+{
+ assert(_sched_is_scheduled(irn));
+ return get_irn_sched_info(irn)->time_step;
+}
+
+/**
+ * Checks, if a node is to appear in a schedule. Such nodes either
+ * consume real data (mode datab) or produce such.
+ * @param irn The node to check for.
+ * @return 1, if the node consumes/produces data, false if not.
+ */
+static inline int to_appear_in_schedule(const ir_node *irn)
+{
+ switch(get_irn_opcode(irn)) {
+ case iro_Start:
+ case iro_Jmp:
+ case iro_Break:
+ return 1;
+ case iro_Proj:
+ return 0;
+ default:
+ return is_data_node(irn);
+ }
+}
+
+/**
+ * Check, if an ir_node has a scheduling successor.
+ * @param irn The ir node.
+ * @return 1, if the node has a scheduling successor, 0 if not.
+ */
+static inline int _sched_has_next(const ir_node *irn)
+{
+ const sched_info_t *info = get_irn_sched_info(irn);
+ const ir_node *block = is_Block(irn) ? irn : get_nodes_block(irn);
+ return info->next != block;
+}
+
+/**
+ * Check, if an ir_node has a scheduling predecessor.
+ * @param irn The ir node.
+ * @return 1, if the node has a scheduling predecessor, 0 if not.
+ */
+static inline int _sched_has_prev(const ir_node *irn)
+{
+ const sched_info_t *info = get_irn_sched_info(irn);
+ const ir_node *block = is_Block(irn) ? irn : get_nodes_block(irn);
+ return info->prev != block;
+}
+
+/**
+ * Get the scheduling successor of a node.
+ * @param irn The node.
+ * @return The next ir node in the schedule or the block, if the node has no next node.
+ */
+static inline ir_node *_sched_next(const ir_node *irn)
+{
+ const sched_info_t *info = get_irn_sched_info(irn);
+ return info->next;
+}
+
+/**
+ * Get the scheduling predecessor of a node.
+ * @param irn The node.
+ * @return The next ir node in the schedule or the block, if the node has no predecessor.
+ * predecessor.
+ */
+static inline ir_node *_sched_prev(const ir_node *irn)
+{
+ const sched_info_t *info = get_irn_sched_info(irn);
+ return info->prev;
+}
+
+/**
+ * Get the first node in a block schedule.
+ * @param block The block of which to get the schedule.
+ * @return The first node in the schedule or the block itself
+ * if there is no node in the schedule.
+ */
+static inline ir_node *_sched_first(const ir_node *block)
+{
+ assert(is_Block(block) && "Need a block here");
+ return _sched_next(block);
+}
+
+/**
+ * Get the last node in a schedule.
+ * @param block The block to get the schedule for.
+ * @return The last ir node in a schedule, or the block itself
+ * if there is no node in the schedule.
+ */
+static inline ir_node *_sched_last(const ir_node *block)
+{
+ assert(is_Block(block) && "Need a block here");
+ return _sched_prev(block);
+}
+
+/**
+ * Reassign the time steps in the schedule.
+ * @param block The schedule to update.
+ */
+void sched_renumber(const ir_node *block);
+
+static inline void _sched_set_time_stamp(const ir_node *irn)
+{
+ sched_info_t *info = get_irn_sched_info(irn);
+ const sched_info_t *prev_info = get_irn_sched_info(info->prev);
+ const sched_info_t *next_info = get_irn_sched_info(info->next);
+ sched_timestep_t before_ts = prev_info->time_step;
+ sched_timestep_t after_ts = next_info->time_step;
+
+ /*
+ * If we are the last, we can give us a big time step,
+ * else we have to compute our time step from our
+ * neighbours.
+ */
+ if(before_ts >= after_ts) {
+ info->time_step = before_ts + SCHED_INITIAL_GRANULARITY;
+ /* overflow? */
+ if (info->time_step <= before_ts) {
+ sched_renumber(get_nodes_block(irn));
+ }
+ } else {
+ sched_timestep_t ts = (before_ts + after_ts) / 2;
+
+ /*
+ * If the resolution went out, we have to renumber
+ * this block.
+ */
+ if(ts == before_ts || ts == after_ts)
+ sched_renumber(get_nodes_block(irn));
+ else
+ info->time_step = ts;
+ }
+}
+
+/**
+ * Add a node to a block schedule.
+ * @param block The block to whose schedule the node shall be added to.
+ * @param irn The node to add.
+ * @return The given node.
+ */
+static inline void _sched_add_before(ir_node *before, ir_node *irn)
+{
+ sched_info_t *info = get_irn_sched_info(irn);
+ ir_node *next = before;
+ sched_info_t *next_info = get_irn_sched_info(next);
+ ir_node *prev = next_info->prev;
+ sched_info_t *prev_info = get_irn_sched_info(prev);
+ assert(_sched_is_scheduled(before));
+ assert(!_sched_is_scheduled(irn));
+ assert(!is_Proj(before));
+ assert(!is_Proj(irn));
+
+ info->prev = prev;
+ info->next = next;
+ prev_info->next = irn;
+ next_info->prev = irn;
+ _sched_set_time_stamp(irn);
+}
+
+/**
+ * Add a node to a block schedule.
+ * @param block The block to whose schedule the node shall be added to.
+ * @param irn The node to add.
+ * @return The given node.
+ */
+static inline void _sched_add_after(ir_node *after, ir_node *irn)
+{
+ sched_info_t *info = get_irn_sched_info(irn);
+ ir_node *prev = after;
+ sched_info_t *prev_info = get_irn_sched_info(prev);
+ ir_node *next = prev_info->next;
+ sched_info_t *next_info = get_irn_sched_info(next);
+ assert(_sched_is_scheduled(after));
+ assert(!_sched_is_scheduled(irn));
+ assert(!is_Proj(after));
+ assert(!is_Proj(irn));
+
+ info->prev = prev;
+ info->next = next;
+ prev_info->next = irn;
+ next_info->prev = irn;
+ _sched_set_time_stamp(irn);
+}
+
+static inline void _sched_init_block(ir_node *block)
+{
+ sched_info_t *info = get_irn_sched_info(block);
+ assert(info->next == NULL && info->time_step == 0);
+ info->next = block;
+ info->prev = block;
+}
+
+static inline void _sched_reset(ir_node *node)
+{
+ sched_info_t *info = get_irn_sched_info(node);
+ info->next = NULL;
+ info->prev = NULL;
+}
+
+/**
+ * Remove a node from the scheduled.
+ * @param irn The node.
+ */
+static inline void _sched_remove(ir_node *irn)
+{
+ sched_info_t *info = get_irn_sched_info(irn);
+ ir_node *prev = info->prev;
+ ir_node *next = info->next;
+ sched_info_t *prev_info = get_irn_sched_info(prev);
+ sched_info_t *next_info = get_irn_sched_info(next);
+ assert(_sched_is_scheduled(irn));
+
+ prev_info->next = next;
+ next_info->prev = prev;
+ info->next = NULL;
+ info->prev = NULL;
+}
+
+/**
+ * Compare two nodes according to their position in the schedule.
+ * @param a The first node.
+ * @param b The second node.
+ * @return A number smaller, equals to or larger than 0, if a is
+ * before, the same, or after b in the schedule.
+ */
+static inline int _sched_cmp(const ir_node *a, const ir_node *b)
+{
+ assert(_sched_is_scheduled(a) && _sched_is_scheduled(b));
+ assert(get_nodes_block(a) == get_nodes_block(b));
+
+ return get_irn_sched_info(a)->time_step - get_irn_sched_info(b)->time_step;
+}
+
+/**
+ * Checks, if one node is scheduled before another.
+ * @param n1 A node.
+ * @param n2 Another node.
+ * @return 1, if n1 is in front of n2 in the schedule, 0 else.
+ * @note Both nodes must be in the same block.
+ */
+static inline int _sched_comes_after(const ir_node *n1, const ir_node *n2)
+{
+ assert(_sched_is_scheduled(n1));
+ assert(_sched_is_scheduled(n2));
+ assert((is_Block(n1) ? n1 : get_nodes_block(n1)) == (is_Block(n2) ? n2 : get_nodes_block(n2)));
+ return _sched_get_time_step(n1) < _sched_get_time_step(n2);
+}
+
+/**
+ * A predicate for a node.
+ * @param irn The node.
+ * @param data The custom data.
+ * @return 1 if irn should be skipped. Else 0.
+ */
+typedef int (sched_predicator_t)(const ir_node *irn, void *data);
+
+/**
+ * Predicate for sched_skip(), returns non-zero if irn is a control flow changing node.
+ *
+ * @param irn the node to evaluate
+ * @param data unused
+ */
+int sched_skip_cf_predicator(const ir_node *irn, void *data);
+
+/**
+ * Predicate for sched_skip(), returns non-zero if irn is a Phi node.
+ *
+ * Used with sched_skip().
+ *
+ * @param irn the node to evaluate
+ * @param data unused
+ */
+int sched_skip_phi_predicator(const ir_node *irn, void *data);
+
+/**
+ * Skip nodes in a schedule.
+ * @param from The node to start from.
+ * @param forward The direction (1 for forward, 0 for backward).
+ * @param predicator The predicator function which decides what is skipped.
+ * @param data context parameter for the predicator.
+ *
+ * @return The first node not rejected by the predicator or the block
+ * itself if all nodes were rejected.
+ */
+ir_node *sched_skip(ir_node *from, int forward, sched_predicator_t *predicator, void *data);
+
+#define have_sched_info(irg) _have_sched_info(irg)
+#define sched_get_time_step(irn) _sched_get_time_step(irn)
+#define sched_has_next(irn) _sched_has_next(irn)
+#define sched_has_prev(irn) _sched_has_prev(irn)
+#define sched_next(irn) _sched_next(irn)
+#define sched_prev(irn) _sched_prev(irn)
+#define sched_first(irn) _sched_first(irn)
+#define sched_last(irn) _sched_last(irn)
+#define sched_add_before(before, irn) _sched_add_before(before, irn)
+#define sched_add_after(after, irn) _sched_add_after(after, irn)
+#define sched_remove(irn) _sched_remove(irn)
+#define sched_is_scheduled(irn) _sched_is_scheduled(irn)
+#define sched_comes_after(n1, n2) _sched_comes_after(n1, n2)
+#define sched_cmp(a, b) _sched_cmp(a, b)
+
+
+
#endif
+++ /dev/null
-/*
- * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved.
- *
- * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
- */
-
-/**
- * @file
- * @brief Scheduling utilities for nodes in Blocks and Blocks.
- * @author Sebastian Hack, Matthias Braun
- * @version $Id$
- */
-#ifndef FIRM_BE_BESCHED_T_H
-#define FIRM_BE_BESCHED_T_H
-
-#define SCHED_INITIAL_GRANULARITY (1 << 14)
-
-#include "list.h"
-#include "irnode_t.h"
-#include "irgraph_t.h"
-#include "irphase_t.h"
-#include "irphases_t.h"
-
-#include "beutil.h"
-#include "besched.h"
-#include "beinfo.h"
-
-#define get_irn_sched_info(irn) (&be_get_info(skip_Proj_const(irn))->sched_info)
-
-/**
- * Returns non-zero if schedule information is available
- * for a given graph.
- * @param irg The graph.
- */
-static inline int _have_sched_info(const ir_graph *irg)
-{
- return be_info_initialized(irg);
-}
-
-/**
- * Check, if the node is scheduled.
- * @param irn The node.
- * @return 1, if the node is scheduled, 0 if not.
- */
-static inline int _sched_is_scheduled(const ir_node *irn)
-{
- return get_irn_sched_info(irn)->next != NULL;
-}
-
-/**
- * Get the time step of an irn in a schedule.
- * @param irn The node.
- * @return The time step in the schedule.
- */
-static inline int _sched_get_time_step(const ir_node *irn)
-{
- assert(_sched_is_scheduled(irn));
- return get_irn_sched_info(irn)->time_step;
-}
-
-/**
- * Checks, if a node is to appear in a schedule. Such nodes either
- * consume real data (mode datab) or produce such.
- * @param irn The node to check for.
- * @return 1, if the node consumes/produces data, false if not.
- */
-static inline int to_appear_in_schedule(const ir_node *irn)
-{
- switch(get_irn_opcode(irn)) {
- case iro_Start:
- case iro_Jmp:
- case iro_Break:
- return 1;
- case iro_Proj:
- return 0;
- default:
- return is_data_node(irn);
- }
-}
-
-/**
- * Check, if an ir_node has a scheduling successor.
- * @param irn The ir node.
- * @return 1, if the node has a scheduling successor, 0 if not.
- */
-static inline int _sched_has_next(const ir_node *irn)
-{
- const sched_info_t *info = get_irn_sched_info(irn);
- const ir_node *block = is_Block(irn) ? irn : get_nodes_block(irn);
- return info->next != block;
-}
-
-/**
- * Check, if an ir_node has a scheduling predecessor.
- * @param irn The ir node.
- * @return 1, if the node has a scheduling predecessor, 0 if not.
- */
-static inline int _sched_has_prev(const ir_node *irn)
-{
- const sched_info_t *info = get_irn_sched_info(irn);
- const ir_node *block = is_Block(irn) ? irn : get_nodes_block(irn);
- return info->prev != block;
-}
-
-/**
- * Get the scheduling successor of a node.
- * @param irn The node.
- * @return The next ir node in the schedule or the block, if the node has no next node.
- */
-static inline ir_node *_sched_next(const ir_node *irn)
-{
- const sched_info_t *info = get_irn_sched_info(irn);
- return info->next;
-}
-
-/**
- * Get the scheduling predecessor of a node.
- * @param irn The node.
- * @return The next ir node in the schedule or the block, if the node has no predecessor.
- * predecessor.
- */
-static inline ir_node *_sched_prev(const ir_node *irn)
-{
- const sched_info_t *info = get_irn_sched_info(irn);
- return info->prev;
-}
-
-/**
- * Get the first node in a block schedule.
- * @param block The block of which to get the schedule.
- * @return The first node in the schedule or the block itself
- * if there is no node in the schedule.
- */
-static inline ir_node *_sched_first(const ir_node *block)
-{
- assert(is_Block(block) && "Need a block here");
- return _sched_next(block);
-}
-
-/**
- * Get the last node in a schedule.
- * @param block The block to get the schedule for.
- * @return The last ir node in a schedule, or the block itself
- * if there is no node in the schedule.
- */
-static inline ir_node *_sched_last(const ir_node *block)
-{
- assert(is_Block(block) && "Need a block here");
- return _sched_prev(block);
-}
-
-/**
- * Reassign the time steps in the schedule.
- * @param block The schedule to update.
- */
-void sched_renumber(const ir_node *block);
-
-static inline void _sched_set_time_stamp(const ir_node *irn)
-{
- sched_info_t *info = get_irn_sched_info(irn);
- const sched_info_t *prev_info = get_irn_sched_info(info->prev);
- const sched_info_t *next_info = get_irn_sched_info(info->next);
- sched_timestep_t before_ts = prev_info->time_step;
- sched_timestep_t after_ts = next_info->time_step;
-
- /*
- * If we are the last, we can give us a big time step,
- * else we have to compute our time step from our
- * neighbours.
- */
- if(before_ts >= after_ts) {
- info->time_step = before_ts + SCHED_INITIAL_GRANULARITY;
- /* overflow? */
- if (info->time_step <= before_ts) {
- sched_renumber(get_nodes_block(irn));
- }
- } else {
- sched_timestep_t ts = (before_ts + after_ts) / 2;
-
- /*
- * If the resolution went out, we have to renumber
- * this block.
- */
- if(ts == before_ts || ts == after_ts)
- sched_renumber(get_nodes_block(irn));
- else
- info->time_step = ts;
- }
-}
-
-/**
- * Add a node to a block schedule.
- * @param block The block to whose schedule the node shall be added to.
- * @param irn The node to add.
- * @return The given node.
- */
-static inline void _sched_add_before(ir_node *before, ir_node *irn)
-{
- sched_info_t *info = get_irn_sched_info(irn);
- ir_node *next = before;
- sched_info_t *next_info = get_irn_sched_info(next);
- ir_node *prev = next_info->prev;
- sched_info_t *prev_info = get_irn_sched_info(prev);
- assert(_sched_is_scheduled(before));
- assert(!_sched_is_scheduled(irn));
- assert(!is_Proj(before));
- assert(!is_Proj(irn));
-
- info->prev = prev;
- info->next = next;
- prev_info->next = irn;
- next_info->prev = irn;
- _sched_set_time_stamp(irn);
-}
-
-/**
- * Add a node to a block schedule.
- * @param block The block to whose schedule the node shall be added to.
- * @param irn The node to add.
- * @return The given node.
- */
-static inline void _sched_add_after(ir_node *after, ir_node *irn)
-{
- sched_info_t *info = get_irn_sched_info(irn);
- ir_node *prev = after;
- sched_info_t *prev_info = get_irn_sched_info(prev);
- ir_node *next = prev_info->next;
- sched_info_t *next_info = get_irn_sched_info(next);
- assert(_sched_is_scheduled(after));
- assert(!_sched_is_scheduled(irn));
- assert(!is_Proj(after));
- assert(!is_Proj(irn));
-
- info->prev = prev;
- info->next = next;
- prev_info->next = irn;
- next_info->prev = irn;
- _sched_set_time_stamp(irn);
-}
-
-static inline void _sched_init_block(ir_node *block)
-{
- sched_info_t *info = get_irn_sched_info(block);
- assert(info->next == NULL && info->time_step == 0);
- info->next = block;
- info->prev = block;
-}
-
-static inline void _sched_reset(ir_node *node)
-{
- sched_info_t *info = get_irn_sched_info(node);
- info->next = NULL;
- info->prev = NULL;
-}
-
-/**
- * Remove a node from the scheduled.
- * @param irn The node.
- */
-static inline void _sched_remove(ir_node *irn)
-{
- sched_info_t *info = get_irn_sched_info(irn);
- ir_node *prev = info->prev;
- ir_node *next = info->next;
- sched_info_t *prev_info = get_irn_sched_info(prev);
- sched_info_t *next_info = get_irn_sched_info(next);
- assert(_sched_is_scheduled(irn));
-
- prev_info->next = next;
- next_info->prev = prev;
- info->next = NULL;
- info->prev = NULL;
-}
-
-/**
- * Compare two nodes according to their position in the schedule.
- * @param a The first node.
- * @param b The second node.
- * @return A number smaller, equals to or larger than 0, if a is
- * before, the same, or after b in the schedule.
- */
-static inline int _sched_cmp(const ir_node *a, const ir_node *b)
-{
- assert(_sched_is_scheduled(a) && _sched_is_scheduled(b));
- assert(get_nodes_block(a) == get_nodes_block(b));
-
- return get_irn_sched_info(a)->time_step - get_irn_sched_info(b)->time_step;
-}
-
-/**
- * Checks, if one node is scheduled before another.
- * @param n1 A node.
- * @param n2 Another node.
- * @return 1, if n1 is in front of n2 in the schedule, 0 else.
- * @note Both nodes must be in the same block.
- */
-static inline int _sched_comes_after(const ir_node *n1, const ir_node *n2)
-{
- assert(_sched_is_scheduled(n1));
- assert(_sched_is_scheduled(n2));
- assert((is_Block(n1) ? n1 : get_nodes_block(n1)) == (is_Block(n2) ? n2 : get_nodes_block(n2)));
- return _sched_get_time_step(n1) < _sched_get_time_step(n2);
-}
-
-/**
- * A predicate for a node.
- * @param irn The node.
- * @param data The custom data.
- * @return 1 if irn should be skipped. Else 0.
- */
-typedef int (sched_predicator_t)(const ir_node *irn, void *data);
-
-/**
- * Predicate for sched_skip(), returns non-zero if irn is a control flow changing node.
- *
- * @param irn the node to evaluate
- * @param data unused
- */
-int sched_skip_cf_predicator(const ir_node *irn, void *data);
-
-/**
- * Predicate for sched_skip(), returns non-zero if irn is a Phi node.
- *
- * Used with sched_skip().
- *
- * @param irn the node to evaluate
- * @param data unused
- */
-int sched_skip_phi_predicator(const ir_node *irn, void *data);
-
-/**
- * Skip nodes in a schedule.
- * @param from The node to start from.
- * @param forward The direction (1 for forward, 0 for backward).
- * @param predicator The predicator function which decides what is skipped.
- * @param data context parameter for the predicator.
- *
- * @return The first node not rejected by the predicator or the block
- * itself if all nodes were rejected.
- */
-ir_node *sched_skip(ir_node *from, int forward, sched_predicator_t *predicator, void *data);
-
-#define have_sched_info(irg) _have_sched_info(irg)
-#define sched_get_time_step(irn) _sched_get_time_step(irn)
-#define sched_has_next(irn) _sched_has_next(irn)
-#define sched_has_prev(irn) _sched_has_prev(irn)
-#define sched_next(irn) _sched_next(irn)
-#define sched_prev(irn) _sched_prev(irn)
-#define sched_first(irn) _sched_first(irn)
-#define sched_last(irn) _sched_last(irn)
-#define sched_add_before(before, irn) _sched_add_before(before, irn)
-#define sched_add_after(after, irn) _sched_add_after(after, irn)
-#define sched_remove(irn) _sched_remove(irn)
-#define sched_is_scheduled(irn) _sched_is_scheduled(irn)
-#define sched_comes_after(n1, n2) _sched_comes_after(n1, n2)
-#define sched_cmp(a, b) _sched_cmp(a, b)
-
-#endif /* FIRM_BE_BESCHED_T_H */
#include "irgwalk.h"
#include "irtools.h"
#include "irbitset.h"
+#include "irnodeset.h"
#include "height.h"
#include "benode_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "beschedmris.h"
#include "beirg.h"
return mi;
}
-#if 0
-static int compute_height(mris_env_t *env, ir_node *irn, ir_visited_t visited)
-{
- mris_irn_t *mi = get_mris_irn(env, irn);
-
- if(get_irn_visited(irn) >= visited) {
- DBG((env->dbg, LEVEL_3, "\theight of %+F = %d\n", irn, mi->height));
- return mi->height;
- }
-
- else {
- const ir_edge_t *edge;
-
- set_irn_visited(irn, visited);
- mi->height = 0;
-
- foreach_out_edge(irn, edge) {
- ir_node *dep = get_edge_src_irn(edge);
-
- if(!is_Block(dep) && get_nodes_block(dep) == env->bl) {
- int dep_height = compute_height(env, dep, visited);
- mi->height = MAX(mi->height, dep_height);
- }
- }
-
- mi->height++;
- DBG((env->dbg, LEVEL_3, "\tsetting height of %+F = %d\n", irn, mi->height));
- }
-
- return mi->height;
-}
-
-static void compute_heights(mris_env_t *env)
-{
- const ir_edge_t *edge;
- ir_visited_t visited;
-
- visited = get_irg_visited(env->irg) + 1;
- set_irg_visited(env->irg, visited);
-
- foreach_out_edge(env->bl, edge) {
- ir_node *dep = get_edge_src_irn(edge);
- if(to_appear(env, dep))
- compute_height(env, dep, visited);
- }
-}
-#endif
-
#define valid_node(env, dep) (to_appear(env, dep) && !be_is_Keep(dep))
static void grow_all_descendands(mris_env_t *env, ir_node *irn, bitset_t *visited)
return in[0];
}
-#if 0
-static void reaches_walker(mris_env_t *env, ir_node *irn, ir_node *tgt, int *found, ir_visited_t visited)
-{
- if(get_irn_visited(irn) < visited && get_nodes_block(irn) == env->bl) {
-
- set_irn_visited(irn, visited);
-
- if(irn == tgt)
- *found = 1;
- else {
- int i, n;
-
- for(i = 0, n = get_irn_arity(irn); i < n; ++i) {
- ir_node *op = get_irn_n(irn, i);
- if(!*found)
- reaches_walker(env, op, tgt, found, visited);
- }
- }
- }
-}
-
-static int reaches(mris_env_t *env, ir_node *src, ir_node *tgt)
-{
- int found = 0;
- ir_visited_t visited = get_irg_visited(env->irg) + 1;
-
- set_irg_visited(env->irg, visited);
- reaches_walker(env, src, tgt, &found, visited);
- return found;
-}
-#endif
-
static inline ir_node *skip_Projs(ir_node *irn)
{
return is_Proj(irn) ? skip_Projs(get_Proj_pred(irn)) : irn;
}
-#if 0
-static void replace_tuple_by_repr_proj(mris_env_t *env, ir_node **in)
-{
- int i;
-
- for(i = 0; in[i]; ++i) {
- if(get_irn_mode(in[i]) == mode_T) {
- const ir_edge_t *edge;
- ir_node *proj = NULL;
- ir_node *first = NULL;
-
- foreach_out_edge(in[i], edge) {
- ir_node *desc = get_edge_src_irn(edge);
-
- first = first ? first : desc;
- if(get_irn_mode(desc) == mode_M) {
- proj = desc;
- break;
- }
- }
-
- proj = proj ? proj : first;
- assert(proj);
- in[i] = proj;
- }
- }
-}
-#endif
-
static void lineage_formation(mris_env_t *env)
{
DEBUG_ONLY(firm_dbg_module_t *dbg = env->dbg);
#include <stdlib.h>
-#include "besched_t.h"
+#include "besched.h"
#include "belistsched.h"
#include "belive_t.h"
#include "beutil.h"
#include <stdlib.h>
-#include "besched_t.h"
+#include "besched.h"
#include "belistsched.h"
/**
#include "irgwalk.h"
#include "irtools.h"
-#include "besched_t.h"
+#include "besched.h"
#include "belistsched.h"
#include "benode_t.h"
#include "irtools.h"
#include "irbitset.h"
#include "irprintf.h"
+#include "irnodeset.h"
#include "bipartite.h"
#include "hungarian.h"
#include "plist.h"
#include "beabi.h"
#include "bemodule.h"
#include "benode_t.h"
-#include "besched_t.h"
-#include "beirg_t.h"
+#include "besched.h"
+#include "beirg.h"
+#include "belive.h"
#include "lc_opts.h"
#include "lc_opts_enum.h"
#include "iredges_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "belistsched.h"
#include "benode_t.h"
+#include "belive.h"
/* we need a special mark */
static char _mark;
#include "irnodeset.h"
#include "error.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "belive_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "bespill.h"
#include "belive_t.h"
#include "benode_t.h"
#include "bespilloptions.h"
#include "bestatevent.h"
#include "bessaconstr.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "beintlive_t.h"
#include "bemodule.h"
#include "be_t.h"
#include "irnodeset.h"
#include "beutil.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "beuses.h"
-#include "besched_t.h"
+#include "besched.h"
#include "beirgmod.h"
#include "belive_t.h"
#include "benode_t.h"
#include "bechordal_t.h"
#include "bespilloptions.h"
#include "beloopana.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "bespill.h"
#include "bemodule.h"
#include "dfs_t.h"
#include "beutil.h"
-#include "bearch_t.h"
-#include "besched_t.h"
+#include "bearch.h"
+#include "besched.h"
#include "beirgmod.h"
#include "belive_t.h"
#include "benode_t.h"
#include "bechordal_t.h"
#include "bespilloptions.h"
#include "beloopana.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "bemodule.h"
#include "bespill.h"
#include "bespill.h"
#include "beutil.h"
#include "bespilloptions.h"
-#include "besched_t.h"
+#include "besched.h"
#include "be_t.h"
#ifndef NDEBUG
#include "bespill.h"
#include "bemodule.h"
#include "besched.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "be_t.h"
#include "benode_t.h"
#include "beirg.h"
+#include "belive.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
#include "bemodule.h"
#include "be.h"
#include "belive_t.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "bearch.h"
#include "benode_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "bera.h"
#include "beintlive_t.h"
#include "bespilloptions.h"
#include "bemodule.h"
#include "beintlive_t.h"
-#include "beirg_t.h"
-#include "bearch_t.h"
+#include "beirg.h"
+#include "bearch.h"
#define DBG_COALESCING 1
#define DBG_INTERFERENCES 2
#include "bessaconstr.h"
#include "bemodule.h"
-#include "besched_t.h"
+#include "besched.h"
#include "beintlive_t.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "be_t.h"
#include "debug.h"
#include "be_t.h"
#include "beutil.h"
#include "bechordal_t.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "belive_t.h"
#include "benode_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "bestatevent.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "beintlive_t.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL;)
#include "statev.h"
#include "error.h"
-#include "bearch_t.h"
-#include "beirg_t.h"
+#include "bearch.h"
+#include "beirg.h"
#include "bestat.h"
#include "belive_t.h"
#include "besched.h"
#include "irnodemap.h"
#include "adt/cpset.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "beuses.h"
-#include "besched_t.h"
+#include "besched.h"
#include "belive_t.h"
#include "bemodule.h"
#include "benode_t.h"
#include "firm_types.h"
#include "beirg.h"
-#include "bearch_t.h"
+#include "bearch.h"
/**
* Callback that should create a spill for a certain value. Can return NULL
#include "cgana.h"
#include "debug.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "betranshlp.h"
+#include "belive.h"
typedef struct be_transform_env_t {
ir_graph *irg; /**< The irg, the node should be created in */
#include "beutil.h"
#include "belive_t.h"
#include "benode_t.h"
-#include "besched_t.h"
+#include "besched.h"
#include "beirgmod.h"
-#include "bearch_t.h"
+#include "bearch.h"
#include "beuses.h"
#define SCAN_INTERBLOCK_USES
#include "iredges.h"
#include "beutil.h"
-#include "besched_t.h"
-#include "bearch_t.h"
+#include "besched.h"
+#include "bearch.h"
/* Get an always empty set. */
pset *be_empty_set(void)
#include "firm_types.h"
#include "pset.h"
-#include "bearch_t.h"
+#include "bearch.h"
#ifdef _MSC_VER
typedef __int64 long64;
#include "beverify.h"
#include "belive.h"
-#include "besched_t.h"
+#include "besched.h"
#include "benode_t.h"
-#include "beirg_t.h"
+#include "beirg.h"
#include "beintlive_t.h"
static int my_values_interfere(const ir_node *a, const ir_node *b);
#include "instrument.h"
#include "../beabi.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
#include "../benode_t.h"
#include "../belower.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "be.h"
#include "../be_t.h"
#include "../beirgmod.h"
#include "../bestate.h"
#include "../beflags.h"
#include "../betranshlp.h"
+#include "../belistsched.h"
#include "bearch_ia32_t.h"
#include "irgwalk.h"
#include "../benode_t.h"
+#include "../belive.h"
#define AGGRESSIVE_AM
#include "bitset.h"
#include "../betranshlp.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
+#include "../beabi.h"
#include "ia32_architecture.h"
#include "ia32_common_transform.h"
#include "irargs_t.h"
#include "irprog_t.h"
#include "iredges_t.h"
+#include "irtools.h"
#include "execfreq.h"
#include "error.h"
#include "raw_bitset.h"
#include "dbginfo.h"
+#include "lc_opts.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "../benode_t.h"
#include "../beabi.h"
#include "../be_dbgout.h"
#include "../beemitter.h"
#include "../begnuas.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
#include "../be_dbgout.h"
#include "ia32_emitter.h"
#include "pdeq.h"
#include "error.h"
-#include "../bearch_t.h"
-#include "../besched_t.h"
+#include "../bearch.h"
+#include "../besched.h"
#include "../benode_t.h"
#include "bearch_ia32_t.h"
#include "array.h"
#include "../beirgmod.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "../besched.h"
#include "../beabi.h"
#include "../benode_t.h"
#include "../bestate.h"
#include "../beutil.h"
#include "../bessaconstr.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
static ir_entity *fpcw_round = NULL;
static ir_entity *fpcw_truncate = NULL;
#include "irmode.h"
#include "set.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "bearch_ia32_t.h"
#include "gen_ia32_regalloc_if.h"
#include "raw_bitset.h"
#include "xmalloc.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "../beinfo.h"
#include "bearch_ia32_t.h"
#define FIRM_BE_IA32_IA32_NODES_ATTR_H
#include "firm_types.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "../bemachine.h"
#include "irnode_t.h"
#include "../be_t.h"
#include "../beabi.h"
#include "../benode_t.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "../bepeephole.h"
#include "ia32_new_nodes.h"
latency => 2,
},
-# SSE3 firsttp instruction
+# SSE3 fisttp instruction
fisttp => {
state => "exc_pinned",
rd_constructor => "NONE",
#include "../besched.h"
#include "../beabi.h"
#include "../beutil.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
#include "../betranshlp.h"
#include "../be_t.h"
#include "error.h"
#include "../belive_t.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "../benode_t.h"
#include "bearch_ia32_t.h"
#include "ia32_new_nodes.h"
#include "bitset.h"
#include "debug.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "../benode_t.h"
#include "../belower.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "../beblocksched.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
#include "be.h"
#include "../beabi.h"
#include "../bemachine.h"
#ifndef FIRM_BE_MIPS_BEARCH_MIPS_H
#define FIRM_BE_MIPS_BEARCH_MIPS_H
-#include "../bearch_t.h"
+#include "../bearch.h"
typedef struct mips_code_gen_t mips_code_gen_t;
#include "irnode.h"
#include "set.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "mips_nodes_attr.h"
int mips_cmp_irn_reg_assoc(const void *a, const void *b, size_t len);
#include "irprintf.h"
#include "xmalloc.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "mips_nodes_attr.h"
#include "mips_new_nodes.h"
#ifndef FIRM_BE_MIPS_MIPS_NODES_ATTR_H
#define FIRM_BE_MIPS_MIPS_NODES_ATTR_H
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "irmode_t.h"
#include "irnode_t.h"
#include "mips_scheduler.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "be.h"
#include "../beabi.h"
+#include "../belistsched.h"
#include "iredges.h"
#include "ircons.h"
#include "gen_mips_regalloc_if.h"
#ifndef FIRM_BE_MIPS_MIPS_SCHEDULER_H
#define FIRM_BE_MIPS_MIPS_SCHEDULER_H
-#include "../besched_t.h"
+#include "../besched.h"
const list_sched_selector_t *mips_get_list_sched_selector(const void *self, list_sched_selector_t *selector);
const ilp_sched_selector_t *mips_get_ilp_sched_selector(const void *self);
#include "../benode_t.h"
#include "../beabi.h"
#include "../besched.h"
-#include "../besched_t.h"
-#include "../beirg_t.h"
+#include "../besched.h"
+#include "../beirg.h"
#include "../betranshlp.h"
#include "bearch_mips_t.h"
#include "debug.h"
#include "error.h"
-#include "../bearch_t.h" /* the general register allocator interface */
+#include "../bearch.h" /* the general register allocator interface */
#include "../benode_t.h"
#include "../belower.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "be.h"
#include "../beabi.h"
#include "../bemachine.h"
#include "../bemodule.h"
#include "../bespillslots.h"
#include "../beblocksched.h"
-#include "../beirg_t.h"
+#include "../beirg.h"
#include "../begnuas.h"
+#include "../belistsched.h"
#include "pset.h"
#ifndef FIRM_BE_PPC32_BEARCH_PPC32_H
#define FIRM_BE_PPC32_BEARCH_PPC32_H
-#include "../bearch_t.h"
+#include "../bearch.h"
extern const arch_isa_if_t ppc32_isa_if;
#include "irargs_t.h"
#include "error.h"
-#include "../besched_t.h"
+#include "../besched.h"
#include "../benode_t.h"
#include "ppc32_emitter.h"
#include "irargs_t.h"
#include "debug.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "bearch_ppc32_t.h"
#include "irnode.h"
#include "set.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "ppc32_nodes_attr.h"
int ppc32_cmp_irn_reg_assoc(const void *a, const void *b, size_t len);
#include "irprintf.h"
#include "xmalloc.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
#include "ppc32_nodes_attr.h"
#include "ppc32_new_nodes.h"
#define FIRM_BE_PPC32_PPC32_NODES_ATTR_H
#include "irnode_t.h"
-#include "../bearch_t.h"
+#include "../bearch.h"
typedef struct
{