X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeprofile.h;h=ca2c930c2a3d9ad0fb2091e7f57f7060f03d0b53;hb=b0e09fe0aada2e5d9dc0299e969b3c93c1092d97;hp=aba585c3b1865016edbf5b30b29b0e715a08f079;hpb=045467067fcbaad5f012e862cc48e987b17d4fa0;p=libfirm diff --git a/ir/be/beprofile.h b/ir/be/beprofile.h index aba585c3b..ca2c930c2 100644 --- a/ir/be/beprofile.h +++ b/ir/be/beprofile.h @@ -1,13 +1,76 @@ -/** vim: set sw=4 ts=4: - * @file beprofile.h - * @date 2006-04-06 - * @author Adam M. Szalkowski +/* + * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. * - * Code instrumentation and execution count profiling + * This file is part of libFirm. * - * Copyright (C) 2006 Universitaet Karlsruhe - * Released under the GPL + * 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. + */ + +/** + * @file + * @brief Code instrumentation and execution count profiling. + * @author Adam M. Szalkowski + * @date 06.04.2006 + * @version $Id$ + */ +#ifndef FIRM_BE_BEPROFILE_H +#define FIRM_BE_BEPROFILE_H + +#include "irgraph.h" +#include "irnode.h" + +/** Additional flags for profiling */ +enum profile_flags { + profile_with_locations = 0x0001, /**< create location table */ + profile_default = 0 /**< default settings */ +}; + +/** + * Instruments irgs with profile code + * + * @param filename The name of the output file for the profile information + * @param flags Additional flags + * + * @return The irg doing the profile initialization. + */ +ir_graph *be_profile_instrument(const char *filename, unsigned flags); + +/** + * Reads the corresponding profile info file if it exists and returns a + * profile info struct + * @param filename The name of the file containing profile information + */ +void be_profile_read(const char *filename); + +/** + * Frees the profile info + */ +void be_profile_free(void); + +/** + * Get block execution count as determined be profiling + */ +unsigned int be_profile_get_block_execcount(const ir_node * block); + +/** + * Initializes exec_freq structure for an irg based on profile data + */ +ir_exec_freq *be_create_execfreqs_from_profile(ir_graph *irg); + +/** + * Tells whether profile module has acquired data */ +int be_profile_has_data(void); -void be_profile_instrument(void); -void be_profile_read(void); +#endif /* FIRM_BE_BEPROFILE_H */