X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firopt.h;h=941d8836c0279505a01938bda3eae39da6554b0b;hb=e5bab593a4048c0a320d7794fb2cb17697da8389;hp=20dc04dfa0f18c97a2eb24d6ef4a16ed1b6bed3f;hpb=b2e11274ee969200b5e3e5135d05c4845de3a39f;p=libfirm diff --git a/ir/ir/iropt.h b/ir/ir/iropt.h index 20dc04dfa..941d8836c 100644 --- a/ir/ir/iropt.h +++ b/ir/ir/iropt.h @@ -1,35 +1,49 @@ -/* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe -** All rights reserved. -** -** Authors: Martin Trapp, Christian Schaefer -** -** Declarations for optimizations intertwined with IR construction. +/* + * Project: libFIRM + * File name: ir/ir/iropt.h + * Purpose: iropt --- optimizations of an ir node. + * Author: Martin Trapp, Christian Schaefer + * Modified by: Goetz Lindenmaier + * Created: + * CVS-ID: $Id$ + * Copyright: (c) 1998-2003 Universität Karlsruhe + * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. + */ + +/** +* @file iropt.h +* +* Declarations for optimizations of an ir node. +* +* @author Martin Trapp, Christian Schaefer */ + # ifndef _IROPT_H_ # define _IROPT_H_ # include "irnode.h" # include "irgraph.h" # include "irflag.h" -# include "pset.h" -# include "tune.h" - -/* optimize_in_place (n) may change the contents of the ir_node itself, - [e.g. by making it a Id-node], but does not change its identity. - So it is safe to be called on already referenced nodes. - - optimize_in_place (n) returns a pointer to a node equivalent to `n' - which should be used instead of `n'. - - optimize (n) may deallocate `n' and everything allocated after `n'! */ +/** If the expression referenced can be evaluated statically + * computed_value returns a tarval representing the result. + * Else returns tarval_bad. */ tarval *computed_value (ir_node *n); -pset *new_identities (void); -void del_identities (pset *value_table); - -ir_node *optimize (ir_node *n); +/** Applies all optimizations to n that are expressible as a pattern + * in Firm, i.e., they need not a walk of the graph. + * Returns a better node for n. Does not free n -- other nodes could + * reference n. + * + * An equivalent optimization is applied in the constructors defined in + * ircons.ch. There n is freed if a better node could be found. + */ ir_node *optimize_in_place (ir_node *n); +/** + * set the default ir op operations + */ +ir_op *firm_set_default_operations(ir_op *op); + # endif /* _IROPT_H_ */