2 /*---------------------------------------------------------------*/
3 /*--- begin ir_opt.h ---*/
4 /*---------------------------------------------------------------*/
7 This file is part of Valgrind, a dynamic binary instrumentation
10 Copyright (C) 2004-2017 OpenWorks LLP
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, see <http://www.gnu.org/licenses/>.
26 The GNU General Public License is contained in the file COPYING.
28 Neither the names of the U.S. Department of Energy nor the
29 University of California nor the names of its contributors may be
30 used to endorse or promote products derived from this software
31 without prior written permission.
34 #ifndef __VEX_IR_OPT_H
35 #define __VEX_IR_OPT_H
37 #include "libvex_basictypes.h"
38 #include "libvex_ir.h"
41 /* Top level optimiser entry point. Returns a new BB. Operates
42 under the control of the global "vex_control" struct and of the
43 supplied |pxControl| argument. */
47 IRExpr
* (*specHelper
) (const HChar
*, IRExpr
**, IRStmt
**, Int
),
48 Bool (*preciseMemExnsFn
)(Int
,Int
,VexRegisterUpdates
),
49 VexRegisterUpdates pxControl
,
54 /* Do a constant folding/propagation pass. */
56 IRSB
* cprop_BB ( IRSB
* );
58 /* Do a dead-code removal pass. bb is destructively modified. */
60 void do_deadcode_BB ( IRSB
* bb
);
62 /* The tree-builder. Make (approximately) maximal safe trees. bb is
63 destructively modified. Returns (unrelatedly, but useful later on)
64 the guest address of the highest addressed byte from any insn in
65 this block, or Addr_MAX if unknown (can that ever happen?) */
67 Addr
ado_treebuild_BB (
69 Bool (*preciseMemExnsFn
)(Int
,Int
,VexRegisterUpdates
),
70 VexRegisterUpdates pxControl
73 #endif /* ndef __VEX_IR_OPT_H */
75 /*---------------------------------------------------------------*/
76 /*--- end ir_opt.h ---*/
77 /*---------------------------------------------------------------*/