-static void post_spill(post_spill_env_t *pse, int iteration) {
- be_chordal_env_t *chordal_env = &pse->cenv;
- be_irg_t *birg = pse->birg;
- ir_graph *irg = birg->irg;
- const be_main_env_t *main_env = birg->main_env;
- be_options_t *main_opts = main_env->options;
- node_stat_t node_stat;
-
-#ifdef FIRM_STATISTICS
- if (be_stat_ev_is_active()) {
- double spillcosts = be_estimate_irg_costs(irg, main_env->arch_env, birg->exec_freq) - pse->pre_spill_cost;
-
- be_stat_tags[STAT_TAG_CLS] = pse->cls->name;
- be_stat_ev_push(be_stat_tags, STAT_TAG_LAST, be_stat_file);
-
- be_stat_ev_l("spillcosts", (long) spillcosts);
-
- node_stats(birg, pse->cls, &node_stat);
- be_stat_ev("phis_after_spill", node_stat.n_phis);
- be_stat_ev("mem_phis", node_stat.n_mem_phis);
- be_stat_ev("reloads", node_stat.n_reloads);
- be_stat_ev("spills", node_stat.n_spills);
- }
-#endif /* FIRM_STATISTICS */
-
- /*
- If we have a backend provided spiller, post spill is
- called in a loop after spilling for each register class.
- But we only need to fix stack nodes once in this case.
- */
- if (iteration == 0) {
- check_for_memory_operands(chordal_env);
- be_abi_fix_stack_nodes(birg->abi, birg->lv);
- }
-
- BE_TIMER_PUSH(ra_timer.t_verify);
-
- /* verify schedule and register pressure */
- if (chordal_env->opts->vrfy_option == BE_CH_VRFY_WARN) {
- be_verify_schedule(irg);
- be_verify_register_pressure(birg, pse->cls, irg);
- }
- else if (chordal_env->opts->vrfy_option == BE_CH_VRFY_ASSERT) {
- assert(be_verify_schedule(irg) && "Schedule verification failed");
- assert(be_verify_register_pressure(birg, pse->cls, irg)
- && "Register pressure verification failed");
- }
- BE_TIMER_POP(ra_timer.t_verify);
+static void post_spill(post_spill_env_t *pse, int iteration)
+{
+ be_chordal_env_t *chordal_env = &pse->cenv;
+ ir_graph *irg = pse->irg;
+ ir_exec_freq *exec_freq = be_get_irg_exec_freq(irg);
+ int allocatable_regs = be_get_n_allocatable_regs(irg, chordal_env->cls);
+
+ /* some special classes contain only ignore regs, no work to be done */
+ if (allocatable_regs > 0) {
+ stat_ev_dbl("bechordal_spillcosts", be_estimate_irg_costs(irg, exec_freq) - pse->pre_spill_cost);
+
+ /*
+ If we have a backend provided spiller, post spill is
+ called in a loop after spilling for each register class.
+ But we only need to fix stack nodes once in this case.
+ */
+ be_timer_push(T_RA_SPILL_APPLY);
+ check_for_memory_operands(irg);
+ if (iteration == 0) {
+ be_abi_fix_stack_nodes(irg);
+ }
+ be_timer_pop(T_RA_SPILL_APPLY);
+
+
+ /* verify schedule and register pressure */
+ be_timer_push(T_VERIFY);
+ if (chordal_env->opts->vrfy_option == BE_CH_VRFY_WARN) {
+ be_verify_schedule(irg);
+ be_verify_register_pressure(irg, pse->cls);
+ } else if (chordal_env->opts->vrfy_option == BE_CH_VRFY_ASSERT) {
+ assert(be_verify_schedule(irg) && "Schedule verification failed");
+ assert(be_verify_register_pressure(irg, pse->cls)
+ && "Register pressure verification failed");
+ }
+ be_timer_pop(T_VERIFY);