X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeconstrperm.c;h=f493ba7ae9ed04d44a66d301be1d0b6709e51e6d;hb=b46c894cf05a8c569d404ba0ef92c384d76e34d6;hp=5e3d4b3e1782916e7370e0893f82b294246a436f;hpb=416f5cea230b1061936ff71810aeef66044e50f7;p=libfirm diff --git a/ir/be/beconstrperm.c b/ir/be/beconstrperm.c index 5e3d4b3e1..f493ba7ae 100644 --- a/ir/be/beconstrperm.c +++ b/ir/be/beconstrperm.c @@ -5,35 +5,44 @@ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "irgraph_t.h" #include "irnode_t.h" #include "irgwalk.h" #include "bearch.h" +#include "belive_t.h" #include "benode_t.h" #include "besched_t.h" #include "beconstrperm.h" -static void walker_insert_constr_perms(ir_node *irn, void *env) { +static void walker_insert_constr_perms(ir_node *bl, void *env) { + ir_node *irn; be_chordal_env_t *cenv = env; const be_main_env_t *menv = cenv->main_env; const arch_env_t *aenv = menv->arch_env; arch_register_req_t req; int pos, max; - /* check for a restriction of the result (-1) and the operands (0..n) */ - max = get_irn_arity(irn); - for(pos=-1; poscls, cenv->dom_front, sched_prev(irn)); - break; + sched_foreach(bl, irn) { + /* check for a restriction of the result (-1) or one of the operands (0..n) */ + max = get_irn_arity(irn); + for(pos=-1; poscls == arch_get_irn_reg_class(aenv, irn, pos) && req.type == arch_register_req_type_limited) { + insert_Perm_after(menv, cenv->cls, cenv->dom_front, sched_prev(irn)); + /* TODO: Next line is overkill. Update_liveness would suffice. */ + be_liveness(get_irn_irg(bl)); + break; + } } } } void be_insert_constr_perms(be_chordal_env_t *cenv) { - irg_walk_graph(cenv->irg, walker_insert_constr_perms, NULL, cenv); + irg_block_walk_graph(cenv->irg, walker_insert_constr_perms, NULL, cenv); }