aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2019-12-05 13:02:57 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2019-12-05 13:02:57 +0000
commitb0a71a184c6e2ec2cdf5eed90308d4e96fb1beda (patch)
tree017581cfcaebd81bd790d173af7224a41d44a392 /gcc/tree-ssa-forwprop.c
parentf1355c8ddab619f0e5fae40cbdca33d468780b58 (diff)
downloadgcc-b0a71a184c6e2ec2cdf5eed90308d4e96fb1beda.zip
gcc-b0a71a184c6e2ec2cdf5eed90308d4e96fb1beda.tar.gz
gcc-b0a71a184c6e2ec2cdf5eed90308d4e96fb1beda.tar.bz2
re PR tree-optimization/92818 (Typo in vec_perm -> bit_insert pattern)
2019-12-05 Richard Biener <rguenther@suse.de> PR middle-end/92818 * tree-ssa-forwprop.c (simplify_vector_constructor): Improve heuristics on what don't care element to choose. * match.pd (VEC_PERM_EXPR -> BIT_INSERT_EXPR): Fix typo. * gcc.target/i386/pr92818.c: New testcase. From-SVN: r278998
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index a27a4cf..2f9b089 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -2265,9 +2265,12 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi)
sel.quick_push (elts[i].second + elts[i].first * refnelts);
/* And fill the tail with "something". It's really don't care,
and ideally we'd allow VEC_PERM to have a smaller destination
- vector. */
+ vector. As heuristic try to preserve a uniform orig[0] which
+ facilitates later pattern-matching VEC_PERM_EXPR to a
+ BIT_INSERT_EXPR. */
for (; i < refnelts; ++i)
- sel.quick_push (i - elts.length ());
+ sel.quick_push ((elts[0].second == 0 && elts[0].first == 0
+ ? 0 : refnelts) + i);
vec_perm_indices indices (sel, orig[1] ? 2 : 1, refnelts);
if (!can_vec_perm_const_p (TYPE_MODE (perm_type), indices))
return false;