X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fgvn_pre.c;h=d1544855fff06e28f0da5e5089710dbbeddb88f5;hb=8d256d64559a5ee81a207046862ef8b284590f1c;hp=5687189fc39cc841d4dee6370a30716e0c977c8d;hpb=5f4790a24705590534c5c7a96d4ce38fe9234540;p=libfirm diff --git a/ir/opt/gvn_pre.c b/ir/opt/gvn_pre.c index 5687189fc..d1544855f 100644 --- a/ir/opt/gvn_pre.c +++ b/ir/opt/gvn_pre.c @@ -1,25 +1,38 @@ /* - * Project: libFIRM - * File name: ir/opt/gvn_pre.c - * Purpose: Global Value Numbering Partial Redundancy Elimination - * (VanDrunen Hosking 2004) - * Author: Michael Beck, Rubino Geiss - * Created: - * CVS-ID: $Id$ - * Copyright: (c) 1998-2006 Universität Karlsruhe - * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + * Copyright (C) 1995-2007 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. */ +/** + * @file + * @brief Global Value Numbering Partial Redundancy Elimination + * (VanDrunen Hosking 2004) + * @author Michael Beck, Rubino Geiss + * @version $Id$ + * @summary + * + * Currently completely broken because our sets do NOT preserve + * the topological sort! + */ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#ifdef HAVE_MALLOC_H -# include -#endif -#ifdef HAVE_ALLOCA_H -# include -#endif +#include "iroptimize.h" #include @@ -36,7 +49,7 @@ #include "ircons.h" #include "irgmod.h" #include "debug.h" -#include "gvn_pre.h" +#include "xmalloc.h" /** The debug module handle. */ DEBUG_ONLY(static firm_dbg_module_t *dbg;) @@ -168,6 +181,7 @@ static int value_cmp(const void *elt, const void *key, size_t size) { const value_entry *e1 = elt; const value_entry *e2 = key; + (void) size; return identities_cmp(e1->value, e2->value); } @@ -963,7 +977,7 @@ static void eliminate_nodes(elim_pair *pairs) /* * Argh: Endless loops cause problems, because the - * insert algorithm did not terminate. We get tranalated nodes that + * insert algorithm did not terminate. We get translated nodes that * references the origin. These nodes are translated again and again... * * The current fix is to use post-dominance. This simple ignores @@ -977,6 +991,8 @@ void do_gvn_pre(ir_graph *irg) block_info *p; unsigned antic_iter, insert_iter; + assert(!"COMPLETELY BROKEN YET, DO NOT USE"); + /* register a debug mask */ FIRM_DBG_REGISTER(dbg, "firm.opt.gvn_pre"); firm_dbg_set_mask(dbg, SET_LEVEL_2);