tree-vect-stmts.c (vectorizable_comparison): Swap operands only once.
authorJoern Rennecke <joern.rennecke@riscy-ip.com>
Tue, 9 Jul 2019 21:55:31 +0000 (21:55 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Tue, 9 Jul 2019 21:55:31 +0000 (22:55 +0100)
* tree-vect-stmts.c (vectorizable_comparison) <!slp_node>:
Swap operands only once.

From-SVN: r273316

gcc/ChangeLog
gcc/tree-vect-stmts.c

index 71569bfa4d6003554c2a4b99015f731cacea6d41..4ae2fd81261a29487b4db936c451d488515863a3 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-09  Joern Rennecke  <joern.rennecke@riscy-ip.com>
+
+       * tree-vect-stmts.c (vectorizable_comparison) <!slp_node>:
+       Swap operands only once.
+
 2019-07-09  Dragan Mladjenovic  <dmladjenovic@wavecomp.com>
 
        * cfgcleanup.c (old_insns_match_p): Check if used hard regs set is equal
index e921225b5ec873e877822a892b19f03f78aa8fb0..601a6f55fbff388c89f88d994e790aebf2bf960e 100644 (file)
@@ -10369,7 +10369,7 @@ vectorizable_comparison (stmt_vec_info stmt_info, gimple_stmt_iterator *gsi,
 
       if (!slp_node)
        {
-         if (swap_p)
+         if (swap_p && j == 0)
            std::swap (vec_rhs1, vec_rhs2);
          vec_oprnds0.quick_push (vec_rhs1);
          vec_oprnds1.quick_push (vec_rhs2);