public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "bergner at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96017] Powerpc suboptimal register spill in likely path Date: Thu, 02 Jul 2020 02:06:32 +0000 [thread overview] Message-ID: <bug-96017-4-8QMrbIJnAu@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-96017-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96017 --- Comment #8 from Peter Bergner <bergner at gcc dot gnu.org> --- Interesting, if I rewrite the test case so that foo is a parameter and not a global var, then we get the code we want: extern void slowpath(int *); int test (int *val, int foo) { int ret = foo; if (__builtin_expect(*val != 0, 0)) slowpath(val); return ret; } 0: addis 2,12,.TOC.-.LCF0@ha addi 2,2,.TOC.-.LCF0@l lwz 9,0(3) cmpwi 0,9,0 bne 0,.L11 mr 3,4 blr .p2align 4,,15 .L11: mflr 0 std 0,16(1) stdu 1,-48(1) std 4,32(1) bl slowpath nop ld 4,32(1) addi 1,1,48 ld 0,16(1) mr 3,4 mtlr 0 blr At first, I thought that split_live_ranges_for_shrink_wrap() split this nicely, but what I found is that IRA assigned a volatile register to a pseudo that is live across a call. LRA then sees that is illegal and spills the pseudo which ends up giving us what we want, but I don't like that. IRA should never assign a volatile register to a pseudo that is live across a call. Yet another thing to look into.
next prev parent reply other threads:[~2020-07-02 2:06 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-01 9:57 [Bug target/96017] New: " npiggin at gmail dot com 2020-07-01 10:01 ` [Bug target/96017] " wschmidt at gcc dot gnu.org 2020-07-01 10:02 ` wschmidt at gcc dot gnu.org 2020-07-01 10:06 ` wschmidt at gcc dot gnu.org 2020-07-01 10:21 ` npiggin at gmail dot com 2020-07-01 14:00 ` bergner at gcc dot gnu.org 2020-07-01 23:58 ` segher at gcc dot gnu.org 2020-07-02 1:18 ` bergner at gcc dot gnu.org 2020-07-02 1:24 ` bergner at gcc dot gnu.org 2020-07-02 2:06 ` bergner at gcc dot gnu.org [this message] 2020-07-02 2:45 ` bergner at gcc dot gnu.org 2020-07-02 21:22 ` segher at gcc dot gnu.org 2020-07-02 21:24 ` segher at gcc dot gnu.org 2021-04-27 11:39 ` jakub at gcc dot gnu.org 2021-07-28 7:04 ` rguenth at gcc dot gnu.org 2023-11-24 8:46 ` jskumari at gcc dot gnu.org 2023-11-24 9:22 ` jskumari 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-96017-4-8QMrbIJnAu@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).