re PR middle-end/80929 (Division with constant no more optimized to mult highpart)
authorJakub Jelinek <jakub@redhat.com>
Wed, 29 Nov 2017 10:31:36 +0000 (11:31 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 29 Nov 2017 10:31:36 +0000 (11:31 +0100)
PR middle-end/80929
* rtlanal.c (seq_cost): For non-single_set insns try to use insn_cost.

From-SVN: r255228

gcc/ChangeLog
gcc/rtlanal.c

index 26c3d24ce96bbc393d2b3a2bbec2b15e5913e3b7..483c02aa501c1b3ef477fff9136e6dfc5cc9f260 100644 (file)
@@ -1,5 +1,8 @@
 2017-11-29  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/80929
+       * rtlanal.c (seq_cost): For non-single_set insns try to use insn_cost.
+
        PR target/80819
        * config/i386/sse.md (vec_concatv2di): Remove * from (=Yr,0,*rm)
        alternative.
index beb24ba573c1176fb8e6debf00d17f3d4ad507e4..c91f3f1d81ee86fb7c935c7c37547df5887e058b 100644 (file)
@@ -5341,8 +5341,14 @@ seq_cost (const rtx_insn *seq, bool speed)
       set = single_set (seq);
       if (set)
         cost += set_rtx_cost (set, speed);
-      else
-        cost++;
+      else if (NONDEBUG_INSN_P (seq))
+       {
+         int this_cost = insn_cost (CONST_CAST_RTX_INSN (seq), speed);
+         if (this_cost > 0)
+           cost += this_cost;
+         else
+           cost++;
+       }
     }
 
   return cost;