From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 191773858D3C; Sun, 7 May 2023 06:57:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 191773858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683442677; bh=bdHmWOhthmUFnLvIoBLTNo3NsYAM/Dnnmdb7LGsaKeA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QRhNtaiwHEjJtNDSHiMJDYEpBNgvE+m/8oR7LnEIZG4lEB+djHrccVW0xrd8FDZsP nEglBtxmqHWBwsSrb1EW8QOuteVAEYd3vIstVVy0Fs8Kj0zbI8kN6JcU1MO3JWfTsv AzCiJ2fTNNymyXhV38uwdy79vQvHONRTOV0Eeod4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/43644] __uint128_t missed optimizations. Date: Sun, 07 May 2023 06:57:56 +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: 4.5.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit 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=3D43644 --- Comment #2 from CVS Commits --- The master branch has been updated by Roger Sayle : https://gcc.gnu.org/g:d8a6945c6ea22efa4d5e42fe1922d2b27953c8cd commit r14-554-gd8a6945c6ea22efa4d5e42fe1922d2b27953c8cd Author: Roger Sayle Date: Sun May 7 07:52:15 2023 +0100 Don't call emit_clobber in lower-subreg.cc's resolve_simple_move. Following up on posts/reviews by Segher and Uros, there's some question over why the middle-end's lower subreg pass emits a clobber (of a multi-word register) into the instruction stream before emitting the sequence of moves of the word-sized parts. This clobber interferes with (LRA) register allocation, preventing the multi-word pseudo to remain in the same hard registers. This patch eliminates this (presumably superfluous) clobber and thereby improves register allocati= on. A concrete example of the observed improvement is PR target/43644. For the test case: __int128 foo(__int128 x, __int128 y) { return x+y; } on x86_64-pc-linux-gnu, gcc -O2 currently generates: foo: movq %rsi, %rax movq %rdi, %r8 movq %rax, %rdi movq %rdx, %rax movq %rcx, %rdx addq %r8, %rax adcq %rdi, %rdx ret with this patch, we now generate the much improved: foo: movq %rdx, %rax movq %rcx, %rdx addq %rdi, %rax adcq %rsi, %rdx ret 2023-05-07 Roger Sayle gcc/ChangeLog PR target/43644 * lower-subreg.cc (resolve_simple_move): Don't emit a clobber immediately before moving a multi-word register by parts. gcc/testsuite/ChangeLog PR target/43644 * gcc.target/i386/pr43644.c: New test case.=