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