From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 826E53858CDB; Wed, 2 Nov 2022 00:38:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 826E53858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667349535; bh=5yOHyjAvaL37xDiKPbRJUJk4ySyi6tFlOEsl97f28+I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=he2NQz14bKtMB//xUa2nQEc4Sqw3B7NdvAJu+LC/ihVjn8yaY7gQ1PcsqlZPEg9Vo TpDCDkIhmHnLJ6gr/hz1aZ33feTRm1rGltiF02mJsVvp5kDaHQ54zRbqB1HUK61RK6 2YqJfyjyiOs4fYU3Ii6wckutrIIhOx+awmg2nwWw= From: "vineetg at rivosinc dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106602] riscv: suboptimal codegen for zero_extendsidi2_shifted w/o bitmanip Date: Wed, 02 Nov 2022 00:38:55 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: vineetg at rivosinc dot com 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: 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=3D106602 --- Comment #11 from Vineet Gupta --- This definitely seems worth pursuing: For bitmanip, following four insn seq matches Trying 7, 8, 6 -> 9: 7: r78:DI=3D0x4000000000 8: r77:DI=3Dr78:DI-0x40 REG_EQUAL 0x3fffffffc0 6: r76:DI=3Dr79:DI<<0x6 9: r75:DI=3Dr76:DI&r77:DI Successfully matched this instruction: (set (reg:DI 75) (and:DI (ashift:DI (reg:DI 79) For non-bitmanip, a similar 3 insn seq doesn't Trying 9, 6 -> 10: 9: r77:DI=3Dr79:DI-0x40 REG_EQUAL 0x3fffffffc0 6: r76:DI=3Dr80:DI<<0x6 10: r75:DI=3Dr76:DI&r77:DI Failed to match this instruction: (set (reg:DI 75) (and:DI (plus:DI (reg:DI 79) (const_int -64 [0xffffffffffffffc0])) (ashift:DI (reg:DI 80) (const_int 6 [0x6])))) If we re-ran last failing case with REQ_EQUAL note it would match.=