From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 03F61385843A; Wed, 6 Mar 2024 11:55:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03F61385843A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709726115; bh=2R2sHyN4cwaFgqLYV5zK/wbyM5scrH4JMcysbyIO6u4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JAzaQdt30SXTyj8Ner7dGMEAndDT4yH/K3zRe8HcQvyt2KPOcrFWmZZkB1iahE9Yd 8QiQv0CDlvWJI6jekV52reflgW+02FXewD3cgQ4CpG/9ZMQ1aewH4NVdchAs4XGG9S PJP1OFmW5kImQKFc7029oANUaSRwFXbUB64Moy44= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114252] Introducing bswapsi reduces code performance Date: Wed, 06 Mar 2024 11:55:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cf_reconfirmed_on bug_status component keywords Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114252 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-03-06 Status|UNCONFIRMED |NEW Component|tree-optimization |target Keywords| |missed-optimization --- Comment #1 from Richard Biener --- Confirmed. It looks like we do no cost evaluation in maybe_optimize_vector_constructor but checking that there's an optab for bswap with SImode. insn-flags.h:#define HAVE_bswapsi2 1 but somehow we end up doing a libcall? We expand as ;; bswapdst_10 =3D __builtin_bswap32 (load_dst_9); (insn 6 5 7 (set (reg:SI 47) (mem:SI (reg/v/f:HI 46 [ buf ]) [0 MEM [(const uint8_t *)buf_5(D)]+0 S4 A8])) -1 (nil)) (insn 7 6 8 (set (reg:SI 22 r22) (reg:SI 47)) -1 (nil)) (insn 8 7 9 (set (reg:SI 22 r22) (bswap:SI (reg:SI 22 r22))) -1 (nil)) ^^^ so why does that turn into a library call? I think this is mis-communication between the middle-end and the target.=