aboutsummaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-01-13 13:48:31 +0100
committerRichard Biener <rguenther@suse.de>2021-01-13 14:51:08 +0100
commit285fa338b06b804e72997c4d876ecf08a9c083af (patch)
tree97ed22c7c131348831676bde0bcb4d1dc9346891 /gcc/match.pd
parenta2d04f3d2c90155bea035d7527a49bc4a6a3397b (diff)
downloadgcc-285fa338b06b804e72997c4d876ecf08a9c083af.zip
gcc-285fa338b06b804e72997c4d876ecf08a9c083af.tar.gz
gcc-285fa338b06b804e72997c4d876ecf08a9c083af.tar.bz2
tree-optimization/92645 - avoid harmful early BIT_FIELD_REF canonicalization
This avoids canonicalizing BIT_FIELD_REF <T1> (a, <sz>, 0) to (T1)a on integer typed a. This confuses the vectorizer SLP matching. With this delayed to after vector lowering the testcase in PR92645 from Skia is now finally optimized to reasonable assembly. 2021-01-13 Richard Biener <rguenther@suse.de> PR tree-optimization/92645 * match.pd (BIT_FIELD_REF to conversion): Delay canonicalization until after vector lowering. * gcc.target/i386/pr92645-7.c: New testcase. * gcc.dg/tree-ssa/ssa-fre-54.c: Adjust. * gcc.dg/pr69047.c: Likewise.
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index c286a54..60c383d 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -6075,6 +6075,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
/* Low-parts can be reduced to integral conversions.
??? The following doesn't work for PDP endian. */
|| (BYTES_BIG_ENDIAN == WORDS_BIG_ENDIAN
+ /* But only do this after vectorization. */
+ && canonicalize_math_after_vectorization_p ()
/* Don't even think about BITS_BIG_ENDIAN. */
&& TYPE_PRECISION (TREE_TYPE (@0)) % BITS_PER_UNIT == 0
&& TYPE_PRECISION (type) % BITS_PER_UNIT == 0