1 /* Header file for the GIMPLE range-op interface.
2 Copyright (C) 2022 Free Software Foundation, Inc.
3 Contributed by Andrew MacLeod <amacleod@redhat.com>
4 and Aldy Hernandez <aldyh@redhat.com>.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #ifndef GCC_GIMPLE_RANGE_OP_H
23 #define GCC_GIMPLE_RANGE_OP_H
28 class gimple_range_op_handler
: public range_op_handler
31 static bool supported_p (gimple
*s
);
32 gimple_range_op_handler (gimple
*s
);
33 inline gimple
*stmt () const { return m_stmt
; }
34 inline tree
lhs () const { return gimple_get_lhs (m_stmt
); }
35 tree
operand1 () const { gcc_checking_assert (m_valid
); return m_op1
; }
36 tree
operand2 () const { gcc_checking_assert (m_valid
); return m_op2
; }
37 bool calc_op1 (vrange
&r
, const vrange
&lhs_range
);
38 bool calc_op1 (vrange
&r
, const vrange
&lhs_range
, const vrange
&op2_range
,
39 relation_trio
= TRIO_VARYING
);
40 bool calc_op2 (vrange
&r
, const vrange
&lhs_range
, const vrange
&op1_range
,
41 relation_trio
= TRIO_VARYING
);
43 void maybe_builtin_call ();
48 // Given stmt S, fill VEC, up to VEC_SIZE elements, with relevant ssa-names
49 // on the statement. For efficiency, it is an error to not pass in enough
50 // elements for the vector. Return the number of ssa-names.
52 unsigned gimple_range_ssa_names (tree
*vec
, unsigned vec_size
, gimple
*stmt
);
54 #endif // GCC_GIMPLE_RANGE_OP_H