]>
Commit | Line | Data |
---|---|---|
f90aa46c | 1 | /* Support routines for Value Range Propagation (VRP). |
8d9254fc | 2 | Copyright (C) 2016-2020 Free Software Foundation, Inc. |
f90aa46c KV |
3 | |
4 | This file is part of GCC. | |
5 | ||
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) | |
9 | any later version. | |
10 | ||
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. | |
15 | ||
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/>. */ | |
19 | ||
96715b4b PK |
20 | #ifndef GCC_TREE_VRP_H |
21 | #define GCC_TREE_VRP_H | |
22 | ||
cca78449 | 23 | #include "value-range.h" |
2506b92c | 24 | |
16207ddd JL |
25 | struct assert_info |
26 | { | |
27 | /* Predicate code for the ASSERT_EXPR. Must be COMPARISON_CLASS_P. */ | |
28 | enum tree_code comp_code; | |
29 | ||
30 | /* Name to register the assert for. */ | |
31 | tree name; | |
32 | ||
33 | /* Value being compared against. */ | |
34 | tree val; | |
35 | ||
36 | /* Expression to compare. */ | |
37 | tree expr; | |
38 | }; | |
39 | ||
40 | extern void register_edge_assert_for (tree, edge, enum tree_code, | |
41 | tree, tree, vec<assert_info> &); | |
42 | extern bool stmt_interesting_for_vrp (gimple *); | |
16207ddd JL |
43 | extern bool infer_value_range (gimple *, tree, tree_code *, tree *); |
44 | ||
028d81b1 | 45 | extern bool range_int_cst_p (const value_range *); |
c49eeac3 | 46 | |
c2ad9885 JL |
47 | extern int compare_values (tree, tree); |
48 | extern int compare_values_warnv (tree, tree, bool *); | |
e7e785df | 49 | extern int operand_less_p (tree, tree); |
c49eeac3 | 50 | |
028d81b1 AH |
51 | void range_fold_unary_expr (value_range *, enum tree_code, tree type, |
52 | const value_range *, tree op0_type); | |
53 | void range_fold_binary_expr (value_range *, enum tree_code, tree type, | |
b00460cb | 54 | const value_range *, const value_range *); |
c49eeac3 | 55 | |
c49eeac3 RB |
56 | extern enum value_range_kind intersect_range_with_nonzero_bits |
57 | (enum value_range_kind, wide_int *, wide_int *, const wide_int &, signop); | |
c49eeac3 | 58 | |
c2ad9885 JL |
59 | extern bool find_case_label_range (gswitch *, tree, tree, size_t *, size_t *); |
60 | extern bool find_case_label_index (gswitch *, size_t, tree, size_t *); | |
c2ad9885 | 61 | extern bool overflow_comparison_p (tree_code, tree, tree, bool, tree *); |
c2ad9885 | 62 | extern tree get_single_symbol (tree, bool *, tree *); |
4aa458f2 | 63 | extern void maybe_set_nonzero_bits (edge, tree); |
54994253 | 64 | extern value_range_kind determine_value_range (tree, wide_int *, wide_int *); |
c49eeac3 | 65 | |
96715b4b | 66 | #endif /* GCC_TREE_VRP_H */ |