From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B6FB53858D39; Fri, 11 Nov 2022 05:05:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6FB53858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668143153; bh=3dJovMKG1MXwBsoDyN44VcKz7UKzRyNJra7KwyWJliY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MmcDdh/tnllVX15FCKuIaRvvGCYQftjRZBhqQbH2zNxzCkXa4Z4ufhH6QZXiojCF8 SbXGoeJdNmowZWcWX2J//IfgYyV7ZrxhwqJCAQ8p3VaSMhc9osQqSklwnAlF6l/4hT a/9UDPy3u5QIBM9W4D2tF19+dC51nO3phhwDzVdc= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106220] x86-64 optimizer forgets about shrd peephole optimization pattern when faced with more than one in close proximity Date: Fri, 11 Nov 2022 05:05:52 +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: 12.1.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: 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=3D106220 --- Comment #4 from Hongtao.liu --- Try to add combine splitter (define_insn_and_split "*x86_64_shrd_lshiftrtti" [(set (match_operand:DI 0 "nonimmediate_operand") (subreg:DI (lshiftrt:TI (match_operand:TI 1 "nonimmediate_operand") (subreg:QI (and:SI (match_operand:SI 2 "register_operand") (const_int 63)) 0)) 0)) (clobber (reg:CC FLAGS_REG))] but failed if there's more than 2 shrd insns since there's flags clobber in the first shrd which prevent the second shrd to be combined. By the time it= 's splitted after reload, it's too later to optimize off redudant cmovne.=