4 * Copyright: (c) Universitaet Karlsruhe
5 * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
15 #include "besched_t.h"
16 #include "beconstrperm.h"
18 static void walker_insert_constr_perms(ir_node *irn, void *env) {
19 be_chordal_env_t *cenv = env;
20 const be_main_env_t *menv = cenv->main_env;
21 const arch_env_t *aenv = menv->arch_env;
22 arch_register_req_t req;
25 /* check for a restriction of the result (-1) and the operands (0..n) */
26 max = get_irn_arity(irn);
27 for(pos=-1; pos<max; ++pos) {
28 arch_get_register_req(aenv, &req, irn, pos);
29 /* if a restriction is found, insert a perm before the irn */
30 if (req.type == arch_register_req_type_limited) {
31 insert_Perm_after(menv, cenv->cls, cenv->dom_front, sched_prev(irn));
37 void be_insert_constr_perms(be_chordal_env_t *cenv) {
38 irg_walk_graph(cenv->irg, walker_insert_constr_perms, NULL, cenv);