added a callback function to check whether a given entity is a allocation call
[libfirm] / ir / opt / ldstopt.h
1 /*
2  * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @brief   Load/Store optimizations.
23  * @author  Michael Beck
24  * @version $Id$
25  */
26 #ifndef FIRM_OPT_LDSTOPT_H
27 #define FIRM_OPT_LDSTOPT_H
28
29 #include "firm_types.h"
30
31 /** Load/Store optimization.
32  *
33  * Removes redundant non-volatile Loads and Stores.
34  * May introduce Bad nodes if exceptional control flow
35  * is removed. The following cases are optimized:
36  *
37  * Load without result: A Load which has only a memory use
38  *   is removed.
39  *
40  * Load after Store: A Load after a Store is removed, if
41  *   the Load doesn't have an exception handler OR is in
42  *   the same block as the Store.
43  *
44  * Load after Load: A Load after a Load is removed, if the
45  *   Load doesn't have an exception handler OR is in the
46  *   same block as the previous Load.
47  *
48  * Store before Store: A Store immediately before another
49  *   Store in the same block is removed, if the Store doesn't
50  *   have an exception handler.
51  *
52  * Store after Load: A Store after a Load is removed, if the
53  *   Store doesn't have an exception handler.
54  */
55 void optimize_load_store(ir_graph *irg);
56
57 #endif /* FIRM_OPT_LDSTOPT_H */