]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/tree-vrp.h
gcov: rename 2 options.
[thirdparty/gcc.git] / gcc / tree-vrp.h
CommitLineData
f90aa46c 1/* Support routines for Value Range Propagation (VRP).
8d9254fc 2 Copyright (C) 2016-2020 Free Software Foundation, Inc.
f90aa46c
KV
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 3, or (at your option)
9any later version.
10
11GCC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along 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
25struct 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
40extern void register_edge_assert_for (tree, edge, enum tree_code,
41 tree, tree, vec<assert_info> &);
42extern bool stmt_interesting_for_vrp (gimple *);
16207ddd
JL
43extern bool infer_value_range (gimple *, tree, tree_code *, tree *);
44
028d81b1 45extern bool range_int_cst_p (const value_range *);
c49eeac3 46
c2ad9885
JL
47extern int compare_values (tree, tree);
48extern int compare_values_warnv (tree, tree, bool *);
e7e785df 49extern int operand_less_p (tree, tree);
c49eeac3 50
028d81b1
AH
51void range_fold_unary_expr (value_range *, enum tree_code, tree type,
52 const value_range *, tree op0_type);
53void range_fold_binary_expr (value_range *, enum tree_code, tree type,
b00460cb 54 const value_range *, const value_range *);
c49eeac3 55
c49eeac3
RB
56extern 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
59extern bool find_case_label_range (gswitch *, tree, tree, size_t *, size_t *);
60extern bool find_case_label_index (gswitch *, size_t, tree, size_t *);
c2ad9885 61extern bool overflow_comparison_p (tree_code, tree, tree, bool, tree *);
c2ad9885 62extern tree get_single_symbol (tree, bool *, tree *);
4aa458f2 63extern void maybe_set_nonzero_bits (edge, tree);
54994253 64extern value_range_kind determine_value_range (tree, wide_int *, wide_int *);
c49eeac3 65
96715b4b 66#endif /* GCC_TREE_VRP_H */