From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6B4F1385B836; Mon, 30 Mar 2020 14:42:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B4F1385B836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585579323; bh=UrphzXblV3G3vzT8XoSHCz1Fj7/BWjWT86p1pjpe8+4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ykgIblfK5xDSpIbnKA3bazCYNNAjBAyEG+Fdwe1GPVemA9a5pUiHUDaJXAttA8XgH s+BMd3m2Q0L3j3iK0rbj7+3mCezgU0q4tIuPi9kKksbKfT+DJFjmHGBGvPYGgLawve axkTys8IqLP732S8eABg5NUYS2iDiUjwSz2+GWjk= From: "vmakarov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94298] x86 duplicates loads Date: Mon, 30 Mar 2020 14:42:03 +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: 10.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: vmakarov at gcc dot gnu.org 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2020 14:42:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94298 --- Comment #5 from Vladimir Makarov --- I think that the root of the problem is that IRA on register cost calculati= on sub-pass chooses memory for the pseudo. It happens because the current algorithm (which is just an adoption of old recglass.c) considers insn alternatives for each operand independently of o= ther operands. Roughly speaking, if we have insn with 2 alternatives and constra= ints 'r,m' for one operand and 'm,r' for another operand, the algorithm considers 'm' for the both operands (or 'r' for the both operands) are perfect (zero cost) match. I've tried to modify the current algorithm by small changes without a succe= ss.=20 The full changes would result in what I have on ira-select branch. ira-sel= ect chooses an insn alternative and then calculate the costs taking this choice into account. Although move insns are a real challenge for such algorithm because they have too many alternatives. Switching to ira-select branch creates a lot of new testsuite failures on s= ome targets for GCC tests expecting a specific code generation and actually does not improve overall SPEC rates on x86-64. I am thinking about combination of the two approaches but it is definitely = not work which could be done for GCC10.=