public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Improve icvt "convert multiple"
@ 2019-08-02 15:10 Robin Dapp
  2019-08-02 15:10 ` [PATCH 5/9] ifcvt: Allow constants operands in noce_convert_multiple_sets Robin Dapp
                   ` (8 more replies)
  0 siblings, 9 replies; 25+ messages in thread
From: Robin Dapp @ 2019-08-02 15:10 UTC (permalink / raw)
  To: gcc-patches; +Cc: james.greenhalgh, rdapp

Hi,

this patch series tries to address some problems of noce_convert_multiple_sets.
The main drawback is that it emits temporaries for each conversion which are
supposed to be eliminated in a later pass but are still included in cost
estimation.

In an attempt to alleviate this I have ifcvt store the number of transformed
moves (patches 1 and 2) to allow backends to simply consider this number when
implementing their own conversion_profitable hook.  This never went upstream
and I included it in this series even though it should not be strictly
necessary after the other changes.

Patch 3 limits the number of situations where temporaries are needed and patch
4 tries to estimate the original seq's costs which was only done after
noce_convert_multiple_sets (and no matter how well the converted seq's costs
were estimated, would always lose against the initial COSTS_N_INSNS(2)).

Patch 6 extracts a comparison vs the condition code.  At least the S/390 and
the i386 backend emit seqs like
  compare
  compare
  cmove
  compare
  cmove
because noce_emit_cmove gets passed a canonicalized comparison (not vs the cc)
causing the backend to create a cc comparison again.

Patch 7 duplicates the noce_emit_cmove mechanism, passing a canonicalized
comparison first, costing the sequence, then passing a cc comparison and
comparing costs of both variants.  The better one is then emitted.

Patch 8 and 9 fix some missing things in patch 7.  I split them for the sake of
clarity.

In total, the series still feels a bit clunky.  If somebody has a nice idea how
to simplify things, I'd gladly incorporate it.  I bootstrapped and regtested on
s390 and i386, ppc is still running.

There are also some changes needed in the S/390 backend that I'm going to send
separately at a later time.

Regards
 Robin

Robin Dapp (9):
  ifcvt: Store the number of created cmovs.
  ifcvt: Use enum instead of transform_name string.
  ifcvt: Only created temporaries as needed.
  ifcvt: Estimate original costs before convert_multiple.
  ifcvt: Allow constants operands in noce_convert_multiple_sets.
  ifcvt: Extract cc comparison from jump.
  ifcvt: Emit two cmov variants and choose the less expensive one.
  ifcvt: Handle swap-style idioms differently.
  ifcvt: Also pass reversed cc comparison.

 gcc/ifcvt.c  | 400 ++++++++++++++++++++++++++++++++++++++++++++-------
 gcc/ifcvt.h  |  71 ++++++++-
 gcc/optabs.c |   9 +-
 gcc/optabs.h |   2 +-
 4 files changed, 421 insertions(+), 61 deletions(-)

-- 
2.17.0

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2019-10-27 14:38 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-02 15:10 [PATCH 0/9] Improve icvt "convert multiple" Robin Dapp
2019-08-02 15:10 ` [PATCH 5/9] ifcvt: Allow constants operands in noce_convert_multiple_sets Robin Dapp
2019-08-06 20:37   ` Richard Sandiford
2019-08-08 10:04     ` Robin Dapp
2019-10-27 14:12   ` Richard Sandiford
2019-08-02 15:10 ` [PATCH 9/9] ifcvt: Also pass reversed cc comparison Robin Dapp
2019-10-27 15:27   ` Richard Sandiford
2019-08-02 15:10 ` [PATCH 4/9] ifcvt: Estimate original costs before convert_multiple Robin Dapp
2019-08-06 20:30   ` Richard Sandiford
2019-08-02 15:10 ` [PATCH 7/9] ifcvt: Emit two cmov variants and choose the less expensive one Robin Dapp
2019-10-27 14:38   ` Richard Sandiford
2019-08-02 15:10 ` [PATCH 2/9] ifcvt: Use enum instead of transform_name string Robin Dapp
2019-08-06 21:03   ` Richard Sandiford
2019-08-08 22:18     ` Jeff Law
2019-08-02 15:10 ` [PATCH 8/9] ifcvt: Handle swap-style idioms differently Robin Dapp
2019-08-06 20:47   ` Richard Sandiford
2019-08-16 13:22     ` Robin Dapp
2019-08-16 15:38       ` Richard Sandiford
2019-08-17 23:48         ` Robin Dapp
2019-08-02 15:10 ` [PATCH 6/9] ifcvt: Extract cc comparison from jump Robin Dapp
2019-10-27 14:31   ` Richard Sandiford
2019-08-02 15:10 ` [PATCH 1/9] ifcvt: Store the number of created cmovs Robin Dapp
2019-08-02 15:10 ` [PATCH 3/9] ifcvt: Only created temporaries as needed Robin Dapp
2019-08-06 20:14   ` Richard Sandiford
2019-08-08  9:13     ` Robin Dapp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).