1 /* Support routines for Value Range Propagation (VRP).
2 Copyright (C) 2016-2017 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_GIMPLE_SSA_EVRP_ANALYZE_H
21 #define GCC_GIMPLE_SSA_EVRP_ANALYZE_H
23 class evrp_range_analyzer
26 evrp_range_analyzer (void);
27 ~evrp_range_analyzer (void)
33 void enter (basic_block
);
34 void leave (basic_block
);
35 void record_ranges_from_stmt (gimple
*);
37 /* Main interface to retrieve range information. */
38 value_range
*get_value_range (const_tree op
)
39 { return vr_values
->get_value_range (op
); }
41 /* Dump all the current value ranges. This is primarily
42 a debugging interface. */
43 void dump_all_value_ranges (FILE *fp
)
44 { vr_values
->dump_all_value_ranges (fp
); }
46 /* A bit of a wart. This should ideally go away. */
47 void vrp_visit_cond_stmt (gcond
*cond
, edge
*e
)
48 { return vr_values
->vrp_visit_cond_stmt (cond
, e
); }
50 /* Get the underlying vr_values class instance. If TRANSFER is
51 true, then we are transferring ownership. Else we keep ownership.
53 This should be converted to a unique_ptr. */
54 class vr_values
*get_vr_values (void) { return vr_values
; }
57 DISABLE_COPY_AND_ASSIGN (evrp_range_analyzer
);
58 class vr_values
*vr_values
;
60 void push_value_range (tree var
, value_range
*vr
);
61 value_range
*pop_value_range (tree var
);
62 value_range
*try_find_new_range (tree
, tree op
, tree_code code
, tree limit
);
63 void record_ranges_from_incoming_edge (basic_block
);
64 void record_ranges_from_phis (basic_block
);
65 void set_ssa_range_info (tree
, value_range
*);
67 /* STACK holds the old VR. */
68 auto_vec
<std::pair
<tree
, value_range
*> > stack
;
71 #endif /* GCC_GIMPLE_SSA_EVRP_ANALYZE_H */