blob: a6c944f57c31bc5f2a60394d76fdb94e7d347577 [file] [log] [blame]
sewardjedf4d692004-08-17 13:52:58 +00001
2/*---------------------------------------------------------------*/
3/*--- ---*/
4/*--- This file (ir/iropt.h) is ---*/
sewardjdbcfae72005-08-02 11:14:04 +00005/*--- Copyright (C) OpenWorks LLP. All rights reserved. ---*/
sewardjedf4d692004-08-17 13:52:58 +00006/*--- ---*/
7/*---------------------------------------------------------------*/
8
sewardjf8ed9d82004-11-12 17:40:23 +00009/*
10 This file is part of LibVEX, a library for dynamic binary
11 instrumentation and translation.
12
sewardj7bd6ffe2005-08-03 16:07:36 +000013 Copyright (C) 2004-2005 OpenWorks LLP. All rights reserved.
sewardjf8ed9d82004-11-12 17:40:23 +000014
sewardj7bd6ffe2005-08-03 16:07:36 +000015 This library is made available under a dual licensing scheme.
sewardjf8ed9d82004-11-12 17:40:23 +000016
sewardj7bd6ffe2005-08-03 16:07:36 +000017 If you link LibVEX against other code all of which is itself
18 licensed under the GNU General Public License, version 2 dated June
19 1991 ("GPL v2"), then you may use LibVEX under the terms of the GPL
20 v2, as appearing in the file LICENSE.GPL. If the file LICENSE.GPL
21 is missing, you can obtain a copy of the GPL v2 from the Free
22 Software Foundation Inc., 51 Franklin St, Fifth Floor, Boston, MA
23 02110-1301, USA.
24
25 For any other uses of LibVEX, you must first obtain a commercial
26 license from OpenWorks LLP. Please contact info@open-works.co.uk
27 for information about commercial licensing.
28
29 This software is provided by OpenWorks LLP "as is" and any express
30 or implied warranties, including, but not limited to, the implied
31 warranties of merchantability and fitness for a particular purpose
32 are disclaimed. In no event shall OpenWorks LLP be liable for any
33 direct, indirect, incidental, special, exemplary, or consequential
34 damages (including, but not limited to, procurement of substitute
35 goods or services; loss of use, data, or profits; or business
36 interruption) however caused and on any theory of liability,
37 whether in contract, strict liability, or tort (including
38 negligence or otherwise) arising in any way out of the use of this
39 software, even if advised of the possibility of such damage.
sewardjf8ed9d82004-11-12 17:40:23 +000040
41 Neither the names of the U.S. Department of Energy nor the
42 University of California nor the names of its contributors may be
43 used to endorse or promote products derived from this software
44 without prior written permission.
sewardjf8ed9d82004-11-12 17:40:23 +000045*/
46
sewardj69933ac2004-12-20 04:12:14 +000047#ifndef __LIBVEX_IROPT_H
48#define __LIBVEX_IROPT_H
49
sewardjedf4d692004-08-17 13:52:58 +000050#include "libvex_basictypes.h"
51#include "libvex_ir.h"
52#include "libvex.h"
53
sewardj49651f42004-10-28 22:11:04 +000054/* Top level optimiser entry point. Returns a new BB. Operates
55 under the control of the global "vex_control" struct. */
56extern
57IRBB* do_iropt_BB ( IRBB* bb,
sewardj9d2e7692005-02-07 01:11:31 +000058 IRExpr* (*specHelper) (HChar*, IRExpr**),
sewardj49651f42004-10-28 22:11:04 +000059 Bool (*preciseMemExnsFn)(Int,Int),
60 Addr64 guest_addr );
sewardjedf4d692004-08-17 13:52:58 +000061
sewardj9578a8b2004-11-04 19:44:48 +000062/* Do a constant folding/propagation pass. */
63extern
64IRBB* cprop_BB ( IRBB* );
65
sewardjf9517d02005-11-28 13:39:37 +000066/* Do a dead-code removal pass. bb is destructively modified. */
sewardj49651f42004-10-28 22:11:04 +000067extern
68void do_deadcode_BB ( IRBB* bb );
69
sewardjf9517d02005-11-28 13:39:37 +000070/* The tree-builder. Make (approximately) maximal safe trees. bb is
71 destructively modified. */
sewardj49651f42004-10-28 22:11:04 +000072extern
sewardjf9517d02005-11-28 13:39:37 +000073void ado_treebuild_BB ( IRBB* bb );
sewardjedf4d692004-08-17 13:52:58 +000074
sewardj69933ac2004-12-20 04:12:14 +000075#endif /* ndef __LIBVEX_IROPT_H */
76
sewardjedf4d692004-08-17 13:52:58 +000077/*---------------------------------------------------------------*/
78/*--- end ir/iropt.h ---*/
79/*---------------------------------------------------------------*/