public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "lin1.hu at intel dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54174] Missed optimization: Unnecessary vmovaps generated for __builtin_ia32_vextractf128_ps256(v, 0) Date: Thu, 16 May 2024 01:50:19 +0000 [thread overview] Message-ID: <bug-54174-4-CVM7AvFlva@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-54174-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54174 Hu Lin <lin1.hu at intel dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lin1.hu at intel dot com --- Comment #4 from Hu Lin <lin1.hu at intel dot com> --- I tried to modify vec_extract_lo_<mode> to: (define_insn "vec_extract_lo_<mode>" [(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=v,v,vm,v") (vec_select:<ssehalfvecmode> (match_operand:VI4F_256 1 "nonimmediate_operand" "0,v,v,vm") (parallel [(const_int 0) (const_int 1) (const_int 2) (const_int 3)])))] and (define_insn "vec_extract_lo_<mode>" [(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=v,?v,?vm,?v") (vec_select:<ssehalfvecmode> (match_operand:VI4F_256 1 "nonimmediate_operand" "0,v,v,vm") (parallel [(const_int 0) (const_int 1) (const_int 2) (const_int 3)])))] In 315r.reload Considering alt=0 of insn 7: (0) =v (1) 0 1 Matching alt: reject+=2 overall=8,losers=1,rld_nregs=1 Considering alt=1 of insn 7: (0) ?v (1) v Staticly defined alt reject+=6 overall=0,losers=0,rld_nregs=0 Choosing alt 1 in insn 7: (0) ?v (1) v {vec_extract_lo_v8sf} and I tried to use !, alt=0 is still rejected. And I even tried to modify (define_insn "vec_extract_lo_<mode>" [(set (match_operand:<ssehalfvecmode> 0 "nonimmediate_operand" "=v") (vec_select:<ssehalfvecmode> (match_operand:VI4F_256 1 "nonimmediate_operand" "0") (parallel [(const_int 0) (const_int 1) (const_int 2) (const_int 3)])))] Although, vec_extract_lo_v8sf uses the same reg %xmm2, compiler will add an extra insn "vmovaps %ymm0, %ymm2" after reload. For the other hand, we tried to split the pattern to [(set (match_dup 0) (match_dup 1))] { operands[1] = gen_lowpart (<ssehalfvecmode>mode, operands[1]); } before reload. But GCC can't execute Register Coalescer like Clang.
prev parent reply other threads:[~2024-05-16 1:50 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-08-04 17:58 [Bug c/54174] New: " dag at nimrod dot no 2012-08-05 10:39 ` [Bug target/54174] " rguenth at gcc dot gnu.org 2021-08-21 19:23 ` pinskia at gcc dot gnu.org 2021-08-23 11:28 ` crazylht at gmail dot com 2024-05-16 1:50 ` lin1.hu at intel dot com [this message]
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-54174-4-CVM7AvFlva@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).