projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BugFix: fixed list_for_each_safe() instance.
[libfirm]
/
ir
/
be
/
belistsched.c
diff --git
a/ir/be/belistsched.c
b/ir/be/belistsched.c
index
893f00d
..
38f04a4
100644
(file)
--- a/
ir/be/belistsched.c
+++ b/
ir/be/belistsched.c
@@
-31,7
+31,7
@@
#include <string.h>
#include <limits.h>
#include <string.h>
#include <limits.h>
-#include "benode
_t
.h"
+#include "benode.h"
#include "be_t.h"
#include "obst.h"
#include "be_t.h"
#include "obst.h"
@@
-49,22
+49,22
@@
#include "irtools.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 "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 "bestat.h"
-#include "beirg
_t
.h"
+#include "beirg.h"
#include "lc_opts.h"
#include "lc_opts_enum.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL);
#include "lc_opts.h"
#include "lc_opts_enum.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg = NULL);
-#define BE_SCHED_NODE(irn) (be_is_Keep(irn) || be_is_CopyKeep(irn) || be_is_
RegParams
(irn))
+#define BE_SCHED_NODE(irn) (be_is_Keep(irn) || be_is_CopyKeep(irn) || be_is_
Start
(irn))
enum {
BE_SCHED_SELECT_TRIVIAL,
enum {
BE_SCHED_SELECT_TRIVIAL,
@@
-159,7
+159,7
@@
typedef struct _block_sched_env_t {
/**
* Returns non-zero if a node must be placed in the schedule.
*/
/**
* Returns non-zero if a node must be placed in the schedule.
*/
-static
INLINE
int must_appear_in_schedule(const list_sched_selector_t *sel, void *block_env, const ir_node *irn)
+static
inline
int must_appear_in_schedule(const list_sched_selector_t *sel, void *block_env, const ir_node *irn)
{
int res = -1;
{
int res = -1;
@@
-177,7
+177,7
@@
static INLINE int must_appear_in_schedule(const list_sched_selector_t *sel, void
/**
* Returns non-zero if the node is already scheduled
*/
/**
* Returns non-zero if the node is already scheduled
*/
-static
INLINE
int is_already_scheduled(block_sched_env_t *env, ir_node *n)
+static
inline
int is_already_scheduled(block_sched_env_t *env, ir_node *n)
{
int idx = get_irn_idx(n);
{
int idx = get_irn_idx(n);
@@
-188,7
+188,7
@@
static INLINE int is_already_scheduled(block_sched_env_t *env, ir_node *n)
/**
* Mark a node as already scheduled
*/
/**
* Mark a node as already scheduled
*/
-static
INLINE
void set_already_scheduled(block_sched_env_t *env, ir_node *n)
+static
inline
void set_already_scheduled(block_sched_env_t *env, ir_node *n)
{
int idx = get_irn_idx(n);
{
int idx = get_irn_idx(n);
@@
-205,7
+205,7
@@
static void add_to_sched(block_sched_env_t *env, ir_node *irn);
* @param irn The node to make ready.
* @return 1, if the node could be made ready, 0 else.
*/
* @param irn The node to make ready.
* @return 1, if the node could be made ready, 0 else.
*/
-static
INLINE
int make_ready(block_sched_env_t *env, ir_node *pred, ir_node *irn)
+static
inline
int make_ready(block_sched_env_t *env, ir_node *pred, ir_node *irn)
{
int i, n;
{
int i, n;
@@
-282,7
+282,8
@@
static void make_users_ready(block_sched_env_t *env, ir_node *irn)
/**
* Returns the number of not yet schedules users.
*/
/**
* Returns the number of not yet schedules users.
*/
-static INLINE int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n) {
+static inline int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n)
+{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
@@
-292,7
+293,8
@@
static INLINE int get_irn_not_sched_user(block_sched_env_t *env, ir_node *n) {
/**
* Sets the number of not yet schedules users.
*/
/**
* Sets the number of not yet schedules users.
*/
-static INLINE void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num) {
+static inline void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num)
+{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
@@
-302,7
+304,8
@@
static INLINE void set_irn_not_sched_user(block_sched_env_t *env, ir_node *n, in
/**
* Add @p num to the number of not yet schedules users and returns the result.
*/
/**
* Add @p num to the number of not yet schedules users and returns the result.
*/
-static INLINE int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num) {
+static inline int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int num)
+{
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
int idx = get_irn_idx(n);
assert(idx < ARR_LEN(env->sched_info));
@@
-313,7
+316,8
@@
static INLINE int add_irn_not_sched_user(block_sched_env_t *env, ir_node *n, int
/**
* Returns the number of users of a node having mode datab.
*/
/**
* Returns the number of users of a node having mode datab.
*/
-static int get_num_successors(ir_node *irn) {
+static int get_num_successors(ir_node *irn)
+{
int sum = 0;
const ir_edge_t *edge;
int sum = 0;
const ir_edge_t *edge;
@@
-345,7
+349,8
@@
static int get_num_successors(ir_node *irn) {
* Adds irn to @p live, updates all inputs that this user is scheduled
* and counts all of its non scheduled users.
*/
* Adds irn to @p live, updates all inputs that this user is scheduled
* and counts all of its non scheduled users.
*/
-static void update_sched_liveness(block_sched_env_t *env, ir_node *irn) {
+static void update_sched_liveness(block_sched_env_t *env, ir_node *irn)
+{
int i;
/* ignore Projs */
int i;
/* ignore Projs */
@@
-423,7
+428,6
@@
static void list_sched_block(ir_node *block, void *env_ptr)
{
sched_env_t *env = env_ptr;
const list_sched_selector_t *selector = env->selector;
{
sched_env_t *env = env_ptr;
const list_sched_selector_t *selector = env->selector;
- ir_node *start_node = get_irg_start(get_irn_irg(block));
block_sched_env_t be;
const ir_edge_t *edge;
block_sched_env_t be;
const ir_edge_t *edge;
@@
-478,12
+482,10
@@
static void list_sched_block(ir_node *block, void *env_ptr)
transfer data flow from the predecessors to this block.
*/
add_to_sched(&be, irn);
transfer data flow from the predecessors to this block.
*/
add_to_sched(&be, irn);
- }
- else if (irn == start_node) {
+ } else if (be_is_Start(irn)) {
/* The start block will be scheduled as the first node */
add_to_sched(&be, irn);
/* The start block will be scheduled as the first node */
add_to_sched(&be, irn);
- }
- else {
+ } else {
/* Other nodes must have all operands in other blocks to be made
* ready */
int ready = 1;
/* Other nodes must have all operands in other blocks to be made
* ready */
int ready = 1;
@@
-663,8
+665,9
@@
void list_sched_single_block(const be_irg_t *birg, ir_node *block,
/**
* Register list scheduler options.
*/
/**
* Register list scheduler options.
*/
-void be_init_listsched(void) {
- lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
+void be_init_listsched(void)
+{
+ lc_opt_entry_t *be_grp = lc_opt_get_grp(firm_opt_get_root(), "be");
lc_opt_entry_t *sched_grp = lc_opt_get_grp(be_grp, "listsched");
lc_opt_add_table(sched_grp, list_sched_option_table);
lc_opt_entry_t *sched_grp = lc_opt_get_grp(be_grp, "listsched");
lc_opt_add_table(sched_grp, list_sched_option_table);