From: Jakub Jelinek Date: Wed, 29 Nov 2017 10:31:36 +0000 (+0100) Subject: re PR middle-end/80929 (Division with constant no more optimized to mult highpart) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cedd8ca58336b0c5b061b3c03c0a646fe08b616c;p=gcc.git re PR middle-end/80929 (Division with constant no more optimized to mult highpart) PR middle-end/80929 * rtlanal.c (seq_cost): For non-single_set insns try to use insn_cost. From-SVN: r255228 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26c3d24ce96..483c02aa501 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2017-11-29 Jakub Jelinek + 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. diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index beb24ba573c..c91f3f1d81e 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -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;