public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108229] [13 Regression] unprofitable STV transform since r13-4873-g0b2c1369d035e928 Date: Tue, 03 Jan 2023 13:38:42 +0000 [thread overview] Message-ID: <bug-108229-4-RwW44oHEFT@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108229-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108229 --- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>: https://gcc.gnu.org/g:de59d8bd163a4b2e50ab566441ab49d7212c3356 commit r13-4976-gde59d8bd163a4b2e50ab566441ab49d7212c3356 Author: Roger Sayle <roger@nextmovesoftware.com> Date: Tue Jan 3 13:37:31 2023 +0000 PR target/108229: A minor STV compute_convert_gain tweak on x86. This patch addresses PR target/108229, which is a change in code generation during the STV pass, due to the recently approved patch to handle vec_select (reductions) in the vector unit. The recent change is innocent, but exposes a latent STV "gain" calculation issue that is benign (or closely balanced) on most microarchitectures. The issue is when STV considers converting PLUS with a MEM operand. On TARGET_64BIT (m=1): addq 24(%rdi), %rdx // 4 bytes or with -m32 (m=2) addl 24(%esi), %eax // 3 bytes adcl 28(%esi), %edx // 3 bytes is being converted by STV to vmovq 24(%rdi), %xmm5 // 5 bytes vpaddq %xmm5, %xmm4, %xmm4 // 4 bytes The current code in general_scalar_chain::compute_convert_gain considers that scalar unit addition is replaced with a vector unit addition (usually about the same cost), but doesn't consider anything special about MEM operands, assuming that a scalar load gains/costs nothing compared to a vector load. We can allow the backend slightly better fine tuning by including in the gain calculation that m scalar loads are being replaced by one vector load, and when optimizing for size including that we're increasing code size (e.g. an extra vmovq instruction for a MEM operand). This patch is a win on the CSiBE benchmark when compiled with -Os. 2023-01-03 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog PR target/108229 * config/i386/i386-features.cc (general_scalar_chain::compute_convert_gain) <case PLUS>: Consider the gain/cost of converting a MEM operand.
next prev parent reply other threads:[~2023-01-03 13:38 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-12-26 17:38 [Bug target/108229] New: [13 Regression] unprofitable STV transform amonakov at gcc dot gnu.org 2022-12-27 12:06 ` [Bug target/108229] [13 Regression] unprofitable STV transform since r13-4873-g0b2c1369d035e928 marxin at gcc dot gnu.org 2022-12-28 9:40 ` roger at nextmovesoftware dot com 2022-12-28 10:37 ` amonakov at gcc dot gnu.org 2023-01-03 13:38 ` cvs-commit at gcc dot gnu.org [this message] 2023-01-07 9:45 ` roger at nextmovesoftware dot com
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-108229-4-RwW44oHEFT@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: linkBe 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).