From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2EE61386CE40; Thu, 30 Jun 2022 08:15:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EE61386CE40 From: "luoxhu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/106069] [12/13 Regression] wrong code with -O -fno-tree-forwprop -maltivec on ppc64le Date: Thu, 30 Jun 2022 08:15: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: 12.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: luoxhu 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: 12.2 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: Thu, 30 Jun 2022 08:15:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106069 --- Comment #5 from luoxhu at gcc dot gnu.org --- Seems combine wrongly merged two vec_select instructions: Trying 188 -> 199: 188: r343:V4SI=3Dvec_select(vec_concat(r168:V4SI,r338:V4SI),parallel) REG_DEAD r338:V4SI REG_DEAD r168:V4SI 199: {r353:SI=3Dvec_select(r343:V4SI,parallel);clobber scratch;} Failed to match this instruction: (parallel [ (set (reg:SI 353) (vec_select:SI (reg:V4SI 338) (parallel [ (const_int 3 [0x3]) ]))) (clobber (scratch:V4SI)) (set (reg:V4SI 343) (vec_select:V4SI (vec_concat:V8SI (reg/v:V4SI 168 [ R02$m_simd = ]) (reg:V4SI 338)) (parallel [ (const_int 2 [0x2]) (const_int 6 [0x6]) (const_int 3 [0x3]) (const_int 7 [0x7]) ]))) ]) Failed to match this instruction: (parallel [ (set (reg:SI 353) (vec_select:SI (reg:V4SI 338) (parallel [ (const_int 3 [0x3]) ]))) (set (reg:V4SI 343) (vec_select:V4SI (vec_concat:V8SI (reg/v:V4SI 168 [ R02$m_simd = ]) (reg:V4SI 338)) (parallel [ (const_int 2 [0x2]) (const_int 6 [0x6]) (const_int 3 [0x3]) (const_int 7 [0x7]) ]))) ]) Successfully matched this instruction: (set (reg:V4SI 343) (vec_select:V4SI (vec_concat:V8SI (reg/v:V4SI 168 [ R02$m_simd ]) (reg:V4SI 338)) (parallel [ (const_int 2 [0x2]) (const_int 6 [0x6]) (const_int 3 [0x3]) (const_int 7 [0x7]) ]))) Successfully matched this instruction: (set (reg:SI 353) (vec_select:SI (reg:V4SI 338) (parallel [ (const_int 3 [0x3]) ]))) allowing combination of insns 188 and 199 original costs 4 + 8 =3D 12 replacement costs 4 + 8 =3D 12 modifying insn i2 188: r343:V4SI=3Dvec_select(vec_concat(r168:V4SI,r338:V4SI),parallel) REG_DEAD r168:V4SI deferring rescan insn with uid =3D 188. modifying insn i3 199: {r353:SI=3Dvec_select(r338:V4SI,parallel);clobber scratch;} REG_DEAD r338:V4SI deferring rescan insn with uid =3D 199.=