This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Try to avoid vector mode punning in SET_DEST on i?86
- From: Jakub Jelinek <jakub at redhat dot com>
- To: James Greenhalgh <james dot greenhalgh at arm dot com>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, Richard Henderson <rth at redhat dot com>, Kirill Yukhin <kirill dot yukhin at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 4 Nov 2013 21:26:30 +0100
- Subject: Re: [PATCH] Try to avoid vector mode punning in SET_DEST on i?86
- Authentication-results: sourceware.org; auth=none
- References: <20131030094713 dot GC27813 at tucnak dot zalov dot cz> <CAFULd4brNCAKn4tD7F5f4JWVto5ujyfubC333O0SwygueazKig at mail dot gmail dot com> <20131030111125 dot GG27813 at tucnak dot zalov dot cz> <20131031164947 dot GV27813 at tucnak dot zalov dot cz> <20131104182319 dot GA26432 at arm dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Nov 04, 2013 at 06:23:19PM +0000, James Greenhalgh wrote:
> > --- gcc/optabs.c.jj 2013-10-29 09:25:45.000000000 +0100
> > +++ gcc/optabs.c 2013-10-31 13:20:40.384808642 +0100
> > @@ -6674,7 +6674,7 @@ expand_vec_perm (enum machine_mode mode,
> > }
> > tmp = gen_rtx_CONST_VECTOR (qimode, vec);
> > sel = gen_lowpart (qimode, sel);
> > - sel = expand_vec_perm (qimode, sel, sel, tmp, NULL);
> > + sel = expand_vec_perm (qimode, gen_reg_rtx (qimode), sel, tmp, NULL);
> > gcc_assert (sel != NULL);
> >
> > /* Add the byte offset to each byte element. */
>
> This hunk causes issues on AArch64 and ARM.
>
> We look to see which permute operation we should generate in
> aarch64_expand_vec_perm_const. If we notice that all elements in
> would select from op0 we copy op0 to op1 and generate appropriate code.
Sorry for that, I've missed that expand_vec_perm has very different
argument order than expand_vec_perm_1 (the former has target last,
the latter second after icode), so misread the code as assigning to sel
when it in fact does a single argument permutation into NULL target.
Apparently this code isn't used on x86_64/i686 at all, so my
bootstrap/regtest has not detected it.
I've reverted that one liner now:
--- ChangeLog (revision 204357)
+++ ChangeLog (working copy)
@@ -1,5 +1,8 @@
2013-11-04 Jakub Jelinek <jakub@redhat.com>
+ * optabs.c (expand_vec_perm): Revert one incorrect line from
+ 2013-10-31 change.
+
PR tree-optimization/58978
* tree-vrp.c (all_imm_uses_in_stmt_or_feed_cond): Don't modify
use_stmt by single_imm_use directly. Only call single_imm_use
--- optabs.c (revision 204356)
+++ optabs.c (working copy)
@@ -6674,7 +6674,7 @@ expand_vec_perm (enum machine_mode mode,
}
tmp = gen_rtx_CONST_VECTOR (qimode, vec);
sel = gen_lowpart (qimode, sel);
- sel = expand_vec_perm (qimode, gen_reg_rtx (qimode), sel, tmp, NULL);
+ sel = expand_vec_perm (qimode, sel, sel, tmp, NULL);
gcc_assert (sel != NULL);
/* Add the byte offset to each byte element. */
Jakub