X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeuses.h;h=17b838ac0217a3417e8a0bedaf7d0dc1f4be48d4;hb=b7936c30acf06e28df82497df4ff2779e6b84b4b;hp=a7cf3936b1a2d13ebc8f494b523052304346848a;hpb=e91c1db21d945d622be14e27bd4c6c405c042723;p=libfirm diff --git a/ir/be/beuses.h b/ir/be/beuses.h index a7cf3936b..17b838ac0 100644 --- a/ir/be/beuses.h +++ b/ir/be/beuses.h @@ -1,32 +1,62 @@ -/** - * @file beuse.h - * @date 27.06.2005 - * @author Sebastian Hack +/* + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. + * + * This file is part of libFirm. * - * Determine future usages of values. + * 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. * - * Copyright (C) 2005 Universitaet Karlsruhe - * Released under the GPL + * 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 Methods to compute when a value will be used again. + * @author Sebastian Hack, Matthias Braun + * @date 27.06.2005 + * @version $Id$ */ +#ifndef FIRM_BE_BEUSES_H +#define FIRM_BE_BEUSES_H + +#include "firm_types.h" +#include "belive.h" + +typedef struct _be_next_use_t { + unsigned time; + int outermost_loop; + const ir_node *before; +} be_next_use_t; -#ifndef _BEUSES_H -#define _BEUSES_H +#define USES_INFINITY 10000000 +#define USES_PENDING 9999999 -#include "bearch.h" +static INLINE int USES_IS_INFINITE(unsigned time) +{ + return time >= USES_INFINITY; +} -#define USES_INFINITY 1000000 -#define USES_IS_INIFINITE(x) ((x) >= USES_INFINITY) +static INLINE int USES_IS_PENDING(unsigned time) +{ + return time == USES_PENDING; +} -typedef struct _loc_t loc_t; typedef struct _be_uses_t be_uses_t; -unsigned be_get_next_use(be_uses_t *uses, const ir_node *from, - unsigned from_step, const ir_node *def, int skip_from_uses); +be_next_use_t be_get_next_use(be_uses_t *uses, ir_node *from, + unsigned from_step, const ir_node *def, + int skip_from_uses); -be_uses_t *be_begin_uses(ir_graph *irg, - const arch_env_t *arch_env, - const arch_register_class_t *cls); +be_uses_t *be_begin_uses(ir_graph *irg, const be_lv_t *lv); void be_end_uses(be_uses_t *uses); -#endif /* _BEUSES_H */ +#endif /* FIRM_BE_BEUSES_H */