X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fana%2Fexecfreq.c;h=7950e5c5eec2f2eada56640a438d7e84b9ff709c;hb=e97a86a5e90141c2cb4ccdc34195cab035627c3f;hp=e07e51b65593f428af5500ff4d066a2621f67d82;hpb=5f489a6cbb73897e6225f310df4786a1d8d64562;p=libfirm diff --git a/ir/ana/execfreq.c b/ir/ana/execfreq.c index e07e51b65..7950e5c5e 100644 --- a/ir/ana/execfreq.c +++ b/ir/ana/execfreq.c @@ -1,20 +1,6 @@ /* - * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. - * * This file is part of libFirm. - * - * This file may be distributed and/or modified under the terms of the - * GNU General Public License version 2 as published by the Free Software - * Foundation and appearing in the file LICENSE.GPL included in the - * packaging of this file. - * - * Licensees holding valid libFirm Professional Edition licenses may use - * this file in accordance with the libFirm Commercial License. - * Agreement provided with the Software. - * - * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE - * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE. + * Copyright (C) 2012 University of Karlsruhe. */ /** @@ -35,7 +21,7 @@ #include "set.h" #include "hashptr.h" #include "debug.h" -#include "statev.h" +#include "statev_t.h" #include "dfs_t.h" #include "absgraph.h" @@ -253,7 +239,8 @@ void ir_estimate_execfreq(ir_graph *irg) int size = dfs_get_n_nodes(dfs); gs_matrix_t *mat = gs_new_matrix(size, size); - ir_node *end_block = get_irg_end_block(irg); + ir_node *const start_block = get_irg_start_block(irg); + ir_node *const end_block = get_irg_end_block(irg); for (int idx = size - 1; idx >= 0; --idx) { const ir_node *bb = (ir_node*)dfs_get_post_num_node(dfs, size-idx-1); @@ -273,8 +260,7 @@ void ir_estimate_execfreq(ir_graph *irg) * Solve A*x = 1*x => (A-I)x = 0 */ if (bb == end_block) { - const ir_node *start_block = get_irg_start_block(irg); - int s_idx = size - dfs_get_post_num(dfs, start_block)-1; + int const s_idx = size - dfs_get_post_num(dfs, start_block) - 1; gs_matrix_set(mat, s_idx, idx, 1.0); } } @@ -285,7 +271,6 @@ void ir_estimate_execfreq(ir_graph *irg) * This avoid strange results for e.g. an irg containing a exit()-call * which block has no cfg successor. */ - ir_node *start_block = get_irg_start_block(irg); int s_idx = size - dfs_get_post_num(dfs, start_block)-1; const ir_node *end = get_irg_end(irg); int n_keepalives = get_End_n_keepalives(end); @@ -309,7 +294,7 @@ void ir_estimate_execfreq(ir_graph *irg) * (note: start_idx is != 0 in strange cases involving endless loops, * probably a misfeature/bug) */ - int start_idx = size-dfs_get_post_num(dfs, get_irg_start_block(irg))-1; + int start_idx = size - dfs_get_post_num(dfs, start_block) - 1; double start_freq = x[start_idx]; double norm = start_freq != 0.0 ? 1.0 / start_freq : 1.0;