diff options
author | Andrew MacLeod <amacleod@redhat.com> | 2022-09-20 19:30:46 -0400 |
---|---|---|
committer | Andrew MacLeod <amacleod@redhat.com> | 2022-09-22 14:48:30 -0400 |
commit | 5608e410914ebb7c8cc9fa50afc8ada3b22cbf2c (patch) | |
tree | 55d1644e49cf3ddb97295a8ad54c3299b966c21c /gcc/gimple-range-op.cc | |
parent | e7f035f66aa25e0537a0e3a76d43c71fe9531724 (diff) | |
download | gcc-5608e410914ebb7c8cc9fa50afc8ada3b22cbf2c.zip gcc-5608e410914ebb7c8cc9fa50afc8ada3b22cbf2c.tar.gz gcc-5608e410914ebb7c8cc9fa50afc8ada3b22cbf2c.tar.bz2 |
Convert CFN_BUILT_IN_PARITY to range-ops.
Also, as the last builtin remaining, also remove the builtin infrastrucure
routines from fold_using_range.
* gimple-range-fold.cc (range_of_range_op): Handle no operands.
(range_of_call): Do not check for builtins.
(fold_using_range::range_of_builtin_call): Delete.
(fold_using_range::range_of_builtin_int_call): Delete.
* gimple-range-fold.h: Adjust prototypes.
* gimple-range-op.cc (class cfn_parity): New.
(gimple_range_op_handler::maybe_builtin_call): Set arguments.
Diffstat (limited to 'gcc/gimple-range-op.cc')
-rw-r--r-- | gcc/gimple-range-op.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/gimple-range-op.cc b/gcc/gimple-range-op.cc index 7629546..d7c6dfa 100644 --- a/gcc/gimple-range-op.cc +++ b/gcc/gimple-range-op.cc @@ -663,6 +663,20 @@ private: bool m_is_pos; } op_cfn_goacc_dim_size (false), op_cfn_goacc_dim_pos (true); + +// Implement range operator for CFN_BUILT_IN_ +class cfn_parity : public range_operator +{ +public: + using range_operator::fold_range; + virtual bool fold_range (irange &r, tree type, const irange &, + const irange &, relation_kind) const + { + r.set (build_zero_cst (type), build_one_cst (type)); + return true; + } +} op_cfn_parity; + // Set up a gimple_range_op_handler for any built in function which can be // supported via range-ops. @@ -795,6 +809,11 @@ gimple_range_op_handler::maybe_builtin_call () m_int = &op_cfn_goacc_dim_pos; break; + CASE_CFN_PARITY: + m_valid = true; + m_int = &op_cfn_parity; + break; + default: break; } |