aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-04-23 21:57:50 +0200
committerJakub Jelinek <jakub@redhat.com>2020-04-23 21:59:01 +0200
commitf51be2fb8653f81092f8158a0f0527275f86603b (patch)
tree138937756a7595d95dae0ac71e325a51598f5103
parent3dbc772128e944819b09e21021d4fcd5dc17f2d4 (diff)
downloadgcc-f51be2fb8653f81092f8158a0f0527275f86603b.zip
gcc-f51be2fb8653f81092f8158a0f0527275f86603b.tar.gz
gcc-f51be2fb8653f81092f8158a0f0527275f86603b.tar.bz2
Shortcut identity VEC_PERM expansion [PR94710]
This PR is about the rs6000 backend emitting wrong assembly for whole vector shift by 0, and while I think it is desirable to fix the backend, I don't see a point why the expander should try to emit that, whole vector shift by 0 is identity, we can just return the operand. 2020-04-23 Jakub Jelinek <jakub@redhat.com> PR target/94710 * optabs.c (expand_vec_perm_const): For shift_amt const0_rtx just return v2.
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/optabs.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5ddb433..54e207c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2020-04-23 Jakub Jelinek <jakub@redhat.com>
+ PR target/94710
+ * optabs.c (expand_vec_perm_const): For shift_amt const0_rtx
+ just return v2.
+
PR middle-end/94724
* tree.c (get_narrower): Instead of creating COMPOUND_EXPRs
temporarily with non-final second operand and updating it later,
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 1456e59..d85ce47 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5627,6 +5627,8 @@ expand_vec_perm_const (machine_mode mode, rtx v0, rtx v1,
if (shift_amt)
{
class expand_operand ops[3];
+ if (shift_amt == const0_rtx)
+ return v2;
if (shift_code != CODE_FOR_nothing)
{
create_output_operand (&ops[0], target, mode);