<commit_before>/**
 * Author:      <NAME>
 * Date:		15.12.2005
 * Copyright:   (c) Universitaet Karlsruhe
 * 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 *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;

	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; pos<max; ++pos) {
			arch_get_register_req(aenv, &req, irn, pos);
			/* if a restriction is found, insert a perm before the irn */
			if (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;
			}<commit_msg>bugfix (check for register class)<commit_after>/**
 * Author:      <NAME>
 * Date:		15.12.2005
 * Copyright:   (c) Universitaet Karlsruhe
 * 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 *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;

	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; pos<max; ++pos) {
			arch_get_register_req(aenv, &req, irn, pos);
			/* if a restriction is found, insert a perm before the irn */
			if (cenv->cls == 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;
			}
{'fraction_non_alphanumeric': 0.13468559837728195, 'fraction_numerical': 0.008924949290060852, 'mean_word_length': 4.1161825726141075, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4078827', 'n_tokens_mistral': 1059, 'n_tokens_neox': 988, 'n_words': 242}