]> git.ipfire.org Git - thirdparty/gcc.git/commit
[rtlanal] Do a better job of costing parallel sets containing flag-setting operations.
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Jun 2017 16:36:57 +0000 (16:36 +0000)
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Jun 2017 16:36:57 +0000 (16:36 +0000)
commita7c4b05ad2fe50233deaf452f98cd5abf80003b7
tree06028456c6a0a69b566fff5f08954e8b2046407d
parentb275f68ef713b6c2c96b639f3f1323485ec1b973
[rtlanal] Do a better job of costing parallel sets containing flag-setting operations.

Many parallel set insns are of the form of a single set that also sets
the condition code flags.  In this case the cost of such an insn is
normally the cost of the part that doesn't set the flags, since
updating the condition flags is simply a side effect.

At present all such insns are treated as having unknown cost (ie 0)
and combine assumes that such insns are infinitely more expensive than
any other insn sequence with a non-zero cost.

This patch addresses this problem by allowing insn_rtx_cost to ignore
the condition setting part of a PARALLEL iff there is exactly one
comparison set and one non-comparison set.  If the only set operation
is a comparison we still use that as the basis of the insn cost.

* rtlanal.c (insn_rtx_cost): If a parallel contains exactly one
comparison set and one other set, use the cost of the non-comparison
set.

Bootstrapped on aarch64-none-linuxgnu

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249850 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/rtlanal.c