diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2020-04-21 11:49:40 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2020-04-21 11:49:40 +0200 |
commit | f5267b36977c5b349cc37447dbd750dee8735214 (patch) | |
tree | e8622a39c6bb5a942a303c2c50ee682f002975dd | |
parent | 608481d7dc74f06e97641cd909c8a1f21881bab8 (diff) | |
download | gcc-f5267b36977c5b349cc37447dbd750dee8735214.zip gcc-f5267b36977c5b349cc37447dbd750dee8735214.tar.gz gcc-f5267b36977c5b349cc37447dbd750dee8735214.tar.bz2 |
Cleanup compute_operand_range.
-rw-r--r-- | gcc/gimple-range-gori.cc | 55 |
1 files changed, 20 insertions, 35 deletions
diff --git a/gcc/gimple-range-gori.cc b/gcc/gimple-range-gori.cc index bdc0398..0a8dcdb 100644 --- a/gcc/gimple-range-gori.cc +++ b/gcc/gimple-range-gori.cc @@ -708,55 +708,40 @@ gori_compute::compute_operand_range (irange &r, gimple *stmt, tree name, const irange *name_range) { - if (is_a<gswitch *> (stmt)) - return compute_operand_range_switch (r, as_a<gswitch *> (stmt), lhs, - name, name_range); - if (!gimple_range_handler (stmt)) - return false; - - tree op1, op2; - bool op1_in_chain, op2_in_chain; - - // Empty ranges are viral as they are on a path which isn't executable. + // Empty ranges are viral as they are on an unexecutable path. if (lhs.undefined_p ()) { r.set_undefined (); return true; } + if (is_a<gswitch *> (stmt)) + return compute_operand_range_switch (r, as_a<gswitch *> (stmt), lhs, + name, name_range); + if (!gimple_range_handler (stmt)) + return false; - op1 = gimple_range_ssa_p (gimple_range_operand1 (stmt)); - op2 = gimple_range_ssa_p (gimple_range_operand2 (stmt)); + tree op1 = gimple_range_ssa_p (gimple_range_operand1 (stmt)); + tree op2 = gimple_range_ssa_p (gimple_range_operand2 (stmt)); // The base ranger handles NAME on this statement. if (op1 == name || op2 == name) return compute_name_range_op (r, stmt, lhs, name, name_range); - // Check for logical combination cases which require developing - // ranges and combining the results based on the operation. if (is_gimple_logical_p (stmt)) - { - bool ret = compute_logical_operands (r, stmt, lhs, name, name_range); - return ret; - } - - // Reaching this point means NAME is not in this stmt, but one of - // the names in it ought to be derived from it. - op1_in_chain = op1 && m_gori_map.in_chain_p (name, op1); - op2_in_chain = op2 && m_gori_map.in_chain_p (name, op2); - + return compute_logical_operands (r, stmt, lhs, name, name_range); + + // NAME is not in this stmt, but one of the names in it ought to be + // derived from it. + bool op1_in_chain = op1 && m_gori_map.in_chain_p (name, op1); + bool op2_in_chain = op2 && m_gori_map.in_chain_p (name, op2); + if (op1_in_chain && op2_in_chain) + return compute_operand1_and_operand2_range (r, stmt, lhs, name, name_range); + if (op1_in_chain) + return compute_operand1_range (r, stmt, lhs, name, name_range); if (op2_in_chain) - { - if (op1_in_chain) - return compute_operand1_and_operand2_range (r, stmt, lhs, name, - name_range); - else - return compute_operand2_range (r, stmt, lhs, name, name_range); - } - else - if (op1_in_chain) - return compute_operand1_range (r, stmt, lhs, name, name_range); + return compute_operand2_range (r, stmt, lhs, name, name_range); - // If neither operand is derived, then this stmt tells us nothing. + // If neither operand is derived, this statement tells us nothing. return false; } |