ldstopt.h 1.32 KB
Newer Older
Michael Beck's avatar
Michael Beck committed
1
2
3
4
5
6
7
/*
 * Project:     libFIRM
 * File name:   ir/opt/ldstopt.h
 * Purpose:     load/store optimizations
 * Author:      Michael Beck
 * Created:
 * CVS-ID:      $Id$
8
 * Copyright:   (c) 1998-2007 Universität Karlsruhe
Michael Beck's avatar
Michael Beck committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
 */

/**
 * @file ldstopt.h
 *
 * Load/Store optimization.
 *
 * @author Michael Beck
 */
#ifndef _LDSTOPT_H_
#define _LDSTOPT_H_

#include "irgraph.h"

/** Load/Store optimization.
 *
26
 * Removes redundant non-volatile Loads and Stores.
Michael Beck's avatar
Michael Beck committed
27
 * May introduce Bad nodes if exceptional control flow
Michael Beck's avatar
Michael Beck committed
28
29
30
31
32
33
 * is removed. The following cases are optimized:
 *
 * Load without result: A Load which has only a memory use
 *   is removed.
 *
 * Load after Store: A Load after a Store is removed, if
34
 *   the Load doesn't have an exception handler OR is in
Michael Beck's avatar
Michael Beck committed
35
36
37
 *   the same block as the Store.
 *
 * Load after Load: A Load after a Load is removed, if the
38
 *   Load doesn't have an exception handler OR is in the
Michael Beck's avatar
Michael Beck committed
39
40
41
42
43
44
45
46
 *   same block as the previous Load.
 *
 * Store before Store: A Store immediately before another
 *   Store in the same block is removed, if the Store doesn't
 *   have an exception handler.
 *
 * Store after Load: A Store after a Load is removed, if the
 *   Store doesn't have an exception handler.
Michael Beck's avatar
Michael Beck committed
47
48
49
50
 */
void optimize_load_store(ir_graph *irg);

#endif /* _LDSTOPT_H_ */