diff options
author | Richard Biener <rguenther@suse.de> | 2015-12-04 08:09:46 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-12-04 08:09:46 +0000 |
commit | 7fe996ba15e8453ea966bd0a62861e012d7045b6 (patch) | |
tree | 5b1f6a744761eba66a206207975df198712c3b92 /gcc | |
parent | e8426e0a22212f9b355364186c9d1748a38b0549 (diff) | |
download | gcc-7fe996ba15e8453ea966bd0a62861e012d7045b6.zip gcc-7fe996ba15e8453ea966bd0a62861e012d7045b6.tar.gz gcc-7fe996ba15e8453ea966bd0a62861e012d7045b6.tar.bz2 |
re PR middle-end/67438 (~X op ~Y pattern relocation causes loop performance degradation on 32bit x86)
2015-12-04 Richard Biener <rguenther@suse.de>
PR middle-end/67438
* match.pd: Guard ~X cmp ~Y -> Y cmp X and the variant with
a constant with single_use.
From-SVN: r231245
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/match.pd | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 977f7ae..0a3fd79 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-04 Richard Biener <rguenther@suse.de> + + PR middle-end/67438 + * match.pd: Guard ~X cmp ~Y -> Y cmp X and the variant with + a constant with single_use. + 2015-12-04 Bin Cheng <bin.cheng@arm.com> Jiong Wang <jiong.wang@arm.com> diff --git a/gcc/match.pd b/gcc/match.pd index ea512fb..5ac30eb 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1855,15 +1855,17 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) /* Fold ~X op ~Y as Y op X. */ (for cmp (simple_comparison) (simplify - (cmp (bit_not @0) (bit_not @1)) - (cmp @1 @0))) + (cmp (bit_not@2 @0) (bit_not@3 @1)) + (if (single_use (@2) && single_use (@3)) + (cmp @1 @0)))) /* Fold ~X op C as X op' ~C, where op' is the swapped comparison. */ (for cmp (simple_comparison) scmp (swapped_simple_comparison) (simplify - (cmp (bit_not @0) CONSTANT_CLASS_P@1) - (if (TREE_CODE (@1) == INTEGER_CST || TREE_CODE (@1) == VECTOR_CST) + (cmp (bit_not@2 @0) CONSTANT_CLASS_P@1) + (if (single_use (@2) + && (TREE_CODE (@1) == INTEGER_CST || TREE_CODE (@1) == VECTOR_CST)) (scmp @0 (bit_not @1))))) (for cmp (simple_comparison) |