public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/112657] [13/14 Regression] missed optimization: cmove not used with multiple returns
Date: Wed, 22 Nov 2023 09:28:40 +0000 [thread overview]
Message-ID: <bug-112657-4-pWTGeVNt5P@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112657-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112657
--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #3)
> (In reply to Andrew Pinski from comment #2)
>
> > Someone will have to debug ifcvt.cc to see why it fails on x86_64 but works
> > on aarch64. Note there are some new changes to ifcvt.cc in review which
> > might improve this, though I am not sure.
>
> x86_64 targetm.noce_conversion_profitable_p returns false for:
Actually, the cost function goes to default_noce_conversion_profitable_p,
where:
(gdb) p cost
$1 = 16
(gdb) p if_info->original_cost
$2 = 8
(gdb) p if_info->max_seq_cost
$3 = 0
For some reason, max_seq_cost remains zero, while on aarch64:
(gdb) p cost
$2 = 12
(gdb) p if_info->original_cost
$3 = 8
(gdb) p if_info->max_seq_cost
$4 = 12
So, x86_64 returns false from the default cost function:
/* When compiling for size, we can make a reasonably accurately guess
at the size growth. When compiling for speed, use the maximum. */
return speed_p && cost <= if_info->max_seq_cost;
next prev parent reply other threads:[~2023-11-22 9:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 21:42 [Bug tree-optimization/112657] New: " goon.pri.low at gmail dot com
2023-11-21 21:53 ` [Bug target/112657] " pinskia at gcc dot gnu.org
2023-11-21 21:53 ` pinskia at gcc dot gnu.org
2023-11-21 21:59 ` [Bug rtl-optimization/112657] [13/14 Regression] " pinskia at gcc dot gnu.org
2023-11-22 9:16 ` ubizjak at gmail dot com
2023-11-22 9:28 ` ubizjak at gmail dot com [this message]
2023-11-22 9:38 ` ubizjak at gmail dot com
2023-11-22 9:46 ` ubizjak at gmail dot com
2023-11-22 10:48 ` rguenth at gcc dot gnu.org
2023-11-22 13:35 ` hubicka at gcc dot gnu.org
2024-03-07 21:01 ` law at gcc dot gnu.org
2024-05-21 9:18 ` [Bug rtl-optimization/112657] [13/14/15 " jakub at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-112657-4-pWTGeVNt5P@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).