X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbelower.c;h=23415d164e75ce741df224d12a1e0a6cf4d677bc;hb=dc8f5481ec78b7925449c547151f8953eee42359;hp=1aae93a4256760293bdeb519036b5f6a3aeddc4c;hpb=ef1c86d10bb0a7c3284d81231d8e60473995e5f7;p=libfirm diff --git a/ir/be/belower.c b/ir/be/belower.c index 1aae93a42..23415d164 100644 --- a/ir/be/belower.c +++ b/ir/be/belower.c @@ -18,7 +18,7 @@ #include "besched.h" #include "irgmod.h" -#include "iredges.h" +#include "iredges_t.h" #include "irgwalk.h" #undef is_Perm @@ -49,6 +49,7 @@ typedef enum _perm_type_t { PERM_COPY } perm_type_t; +/* structure to represent cycles or chains in a perm */ typedef struct _perm_cycle_t { const arch_register_t **elems; /**< the registers in the cycle */ int n_elems; /**< number of elements in the cycle */ @@ -66,6 +67,7 @@ static int compare_reg_pair(const void *a, const void *b) { return -1; } +/* returns the number register pairs marked as checked */ static int get_n_checked_pairs(reg_pair_t *pairs, int n) { int i, n_checked = 0; @@ -280,11 +282,10 @@ static void lower_perm_node(ir_node *irn, void *walk_env) { set_Proj_proj(pairs[i].out_node, get_Proj_proj(pairs[i].in_node)); } - /* remove the proj from the schedule */ sched_remove(pairs[i].out_node); - /* exchange the proj with the argument */ + /* reroute the edges from the proj to the argument */ edges_reroute(pairs[i].out_node, pairs[i].in_node, env->chord_env->irg); pairs[i].checked = 1; @@ -313,7 +314,7 @@ static void lower_perm_node(ir_node *irn, void *walk_env) { continue; } -//todo: - iff PERM_CYCLE && do_copy -> determine free temp reg and insert copy to/from it before/after +//TODO: - iff PERM_CYCLE && do_copy -> determine free temp reg and insert copy to/from it before/after // the copy cascade (this reduces the cycle into a chain) /* build copy/swap nodes from back to front */