From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7443B3858C62; Thu, 31 Aug 2023 04:54:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7443B3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693457681; bh=iiKBGjDcMAh3d57mdsjwd8u3IfQpaUrPECCZ0FT4vpo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Y2JUgHhXZRZnd+xEccpbHiR5iSwngGyuMvHUn28LypYd6ExfChV1xMFAxcaIAMwgN Imqi/7Yc3TbRqBy2nuQsyCY4N8b1hwIFqVGD7kf0QMHhNIgX7CmYjnp7OAPHMUoyei Qi7C0uggoqRVZ9Tnb+x7cbe5pHB+iKlGJAEMlbvA= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111252] LoongArch: Suboptimal code for (a & ~mask) | (b & mask) where mask is a constant with value ((1 << n) - 1) << m Date: Thu, 31 Aug 2023 04:54:41 +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: enhancement X-Bugzilla-Who: xry111 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: 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=3D111252 --- Comment #5 from Xi Ruoyao --- (In reply to Xi Ruoyao from comment #4) > Hmm, this seems a separate issue. The compiler knows to optimize (a & ma= sk) > if mask is ((1 << a) - 1) << b iff a + b =3D 32 or b =3D 0, but not for a= ny I mean "32 or 64". > other masks even if it's "expensive" to materialize the mask:=