aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-07-29 16:29:09 -0700
committerAndrew Pinski <apinski@marvell.com>2023-08-02 01:08:31 -0700
commitee20be8325f7f257ba91a0201cfb3bd6bfbceba9 (patch)
tree695a04db1ed51c0512697a9d902388c839c6dfa8
parent2bae476b511dc441bf61da8a49cca655575e7dd6 (diff)
downloadgcc-ee20be8325f7f257ba91a0201cfb3bd6bfbceba9.zip
gcc-ee20be8325f7f257ba91a0201cfb3bd6bfbceba9.tar.gz
gcc-ee20be8325f7f257ba91a0201cfb3bd6bfbceba9.tar.bz2
Slightly improve bitwise_inverted_equal_p comparisons
This slighly improves bitwise_inverted_equal_p for comparisons. Instead of just comparing the comparisons operands also valueize them. This will allow ccp and others to match the 2 comparisons without an extra pass happening. OK? Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * gimple-match-head.cc (gimple_bitwise_inverted_equal_p): Valueize the comparison operands before comparing them.
-rw-r--r--gcc/gimple-match-head.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/gimple-match-head.cc b/gcc/gimple-match-head.cc
index 0265e55..b1e9630 100644
--- a/gcc/gimple-match-head.cc
+++ b/gcc/gimple-match-head.cc
@@ -319,12 +319,12 @@ gimple_bitwise_inverted_equal_p (tree expr1, tree expr2, tree (*valueize) (tree)
&& TREE_CODE_CLASS (gimple_assign_rhs_code (a1)) == tcc_comparison
&& TREE_CODE_CLASS (gimple_assign_rhs_code (a2)) == tcc_comparison)
{
- tree op10 = gimple_assign_rhs1 (a1);
- tree op20 = gimple_assign_rhs1 (a2);
+ tree op10 = do_valueize (valueize, gimple_assign_rhs1 (a1));
+ tree op20 = do_valueize (valueize, gimple_assign_rhs1 (a2));
if (!operand_equal_p (op10, op20))
return false;
- tree op11 = gimple_assign_rhs2 (a1);
- tree op21 = gimple_assign_rhs2 (a2);
+ tree op11 = do_valueize (valueize, gimple_assign_rhs2 (a1));
+ tree op21 = do_valueize (valueize, gimple_assign_rhs2 (a2));
if (!operand_equal_p (op11, op21))
return false;
if (invert_tree_comparison (gimple_assign_rhs_code (a1),