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/94837] Failure to optimize out spurious movbe into bswap Date: Wed, 29 Apr 2020 09:49:46 +0000 [thread overview] Message-ID: <bug-94837-4-vyJnEmHG6b@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94837-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94837 Uroš Bizjak <ubizjak at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|missed-optimization |ra CC| |vmakarov at gcc dot gnu.org Last reconfirmed| |2020-04-29 Resolution|DUPLICATE |--- Status|RESOLVED |NEW Ever confirmed|0 |1 --- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> --- Looks like RA (tuning?) problem. We enter reload (-O2 -mmovbe -mtune=intel) with: (insn 14 4 2 2 (set (reg:SF 87) (reg:SF 20 xmm0 [ x ])) "pr94837.c":2:1 112 {*movsf_internal} (expr_list:REG_DEAD (reg:SF 20 xmm0 [ x ]) (nil))) (insn 7 6 11 2 (set (subreg:SI (reg:SF 84 [ <retval> ]) 0) (bswap:SI (subreg:SI (reg:SF 87) 0))) "pr94837.c":11:19 869 {*bswapsi2_movbe} (expr_list:REG_DEAD (reg:SF 87) (nil))) (insn 11 7 12 2 (set (reg/i:SF 20 xmm0) (reg:SF 84 [ <retval> ])) "pr94837.c":12:1 112 {*movsf_internal} (expr_list:REG_DEAD (reg:SF 84 [ <retval> ]) (nil))) and this sequence gets reloaded to: (insn 17 6 7 2 (set (mem/c:SI (plus:DI (reg/f:DI 7 sp) (const_int -4 [0xfffffffffffffffc])) [1 %sfp+-4 S4 A32]) (reg:SI 20 xmm0 [87])) "pr94837.c":11:19 67 {*movsi_internal} (nil)) (insn 7 17 16 2 (set (reg:SI 0 ax [88]) (bswap:SI (mem/c:SI (plus:DI (reg/f:DI 7 sp) (const_int -4 [0xfffffffffffffffc])) [1 %sfp+-4 S4 A32]))) "pr94837.c":11:19 869 {*bswapsi2_movbe} (nil)) (insn 16 7 12 2 (set (reg:SI 20 xmm0 [orig:84 <retval> ] [84]) (reg:SI 0 ax [88])) "pr94837.c":11:19 67 {*movsi_internal} (nil)) One would expect reg allocator to choose alternative 0 from: (define_insn "*bswap<mode>2_movbe" [(set (match_operand:SWI48 0 "nonimmediate_operand" "=r,r,m") (bswap:SWI48 (match_operand:SWI48 1 "nonimmediate_operand" "0,m,r")))] "TARGET_MOVBE && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ bswap\t%0 movbe{<imodesuffix>}\t{%1, %0|%0, %1} movbe{<imodesuffix>}\t{%1, %0|%0, %1}" but for some reason this is not the case.
next prev parent reply other threads:[~2020-04-29 9:49 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-29 1:11 [Bug rtl-optimization/94837] New: " gabravier at gmail dot com 2020-04-29 1:48 ` [Bug rtl-optimization/94837] " pinskia at gcc dot gnu.org 2020-04-29 8:26 ` gabravier at gmail dot com 2020-04-29 8:46 ` gabravier at gmail dot com 2020-04-29 9:49 ` ubizjak at gmail dot com [this message] 2020-04-29 9:54 ` ubizjak at gmail 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-94837-4-vyJnEmHG6b@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).