From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 288BE3858C5F; Thu, 29 Feb 2024 22:44:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 288BE3858C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709246648; bh=P/O28GZGGxPvX6m6TfFtaeQYZG28rAYVUZCKnD4QWcs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xSzcv5nQ+ynjJqB2TFS+mKGHKn/qOaT2FgVx02zuzj2jKMrmbuhv8Gr4SfjWFFld4 Sn9VREVA1pJ2v7hjF9hUPHQQKulw8Ne//iR8zW97Z7V3iz0WjI6e9lvUHSrYLLJ98m CFRAWfocIN9hnKJ9PSlMLrTuDp3mNRUFGNEih7X8= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114173] miss optimization of redundant load operation, may confused by type conversion Date: Thu, 29 Feb 2024 22:44:06 +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.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114173 --- Comment #1 from Andrew Pinski --- Trying 7, 8, 9 -> 10: 7: r100:HI=3Dzero_extend([const(`g_63'+0x10)]) 8: {r107:HI=3Dr100:HI+0x1;clobber flags:CC;} REG_UNUSED flags:CC 9: r108:SI=3Dzero_extend(r107:HI) REG_DEAD r107:HI 10: {r109:SI=3Dr108:SI-0x1;clobber flags:CC;} REG_DEAD r108:SI REG_UNUSED flags:CC Failed to match this instruction: (parallel [ (set (reg:SI 109 [ c_8 ]) (zero_extend:SI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI ("g_63") [flags 0x2] ) (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1 A128]))) (clobber (reg:CC 17 flags)) (set (reg:HI 100 [ _3 ]) (zero_extend:HI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI ("g_63") [flags 0x2] ) (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1 A128]))) ]) Failed to match this instruction: (parallel [ (set (reg:SI 109 [ c_8 ]) (zero_extend:SI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI ("g_63") [flags 0x2] ) (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1 A128]))) (set (reg:HI 100 [ _3 ]) (zero_extend:HI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI ("g_63") [flags 0x2] ) (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1 A128]))) ]) Successfully matched this instruction: (set (reg:HI 100 [ _3 ]) (zero_extend:HI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI ("g_63") [f= lags 0x2] ) (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1 A128]))) Successfully matched this instruction: (set (reg:SI 109 [ c_8 ]) (zero_extend:SI (mem/c:QI (const:DI (plus:DI (symbol_ref:DI ("g_63") [f= lags 0x2] ) (const_int 16 [0x10]))) [1 g_63D.2781[4]+0 S1 A128]))) allowing combination of insns 7, 8, 9 and 10 original costs 9 + 4 + 4 + 4 =3D 21 replacement costs 9 + 9 =3D 18 deferring deletion of insn with uid =3D 8. deferring deletion of insn with uid =3D 7. modifying insn i2 9: r100:HI=3Dzero_extend([const(`g_63'+0x10)]) deferring rescan insn with uid =3D 9. modifying insn i3 10: r109:SI=3Dzero_extend([const(`g_63'+0x10)]) deferring rescan insn with uid =3D 10.=