From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 042C03858C5E; Thu, 19 Oct 2023 11:34:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 042C03858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697715268; bh=h1rwJ5dqUfZV7jDy54FdojkRed9PhHgtneaCdm+ntv0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ADu55OQCinMOWHE7aor3MirSKG2Wm8RpFeXaNEJlMNBxJHE0+hcRBbdYH+7xTCd3D P+K/mGN2f/SH7IltjvM1tu6nPEExGdwc9hZD6QD7ftQlY95N3y2gPzt2xIJhMsGTKe PGrUnVomstI2hMKpItRecDV3NDtCZNoV6KGOr3HI= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/111720] RISC-V: Ugly codegen in RVV Date: Thu, 19 Oct 2023 11:34:27 +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: normal X-Bugzilla-Who: rguenther at suse dot de 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=3D111720 --- Comment #20 from rguenther at suse dot de --- On Thu, 19 Oct 2023, juzhe.zhong at rivai dot ai wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111720 >=20 > --- Comment #19 from JuzheZhong --- > (In reply to Richard Biener from comment #18) > > With RVV you have intrinsic calls in GIMPLE so nothing to optimize: > >=20 > > vbool8_t fn () > > { > > vbool8_t vmask; > > vuint8m1_t vand_m; > > vuint8m1_t varr; > > uint8_t arr[32]; > >=20 > > [local count: 1073741824]: > > arr =3D > > "\x01\x02\x07\x01\x03\x04\x05\x03\x01\x00\x01\x02\x04\x04\t\t\x01\x02\x= 07\x01 > > \x03\x04\x05\x03\x01\x00\x01\x02\x04\x04\t\t"; > > varr_3 =3D __riscv_vle8_v_u8m1 (&arr, 32); [return slot optimization] > > vand_m_4 =3D __riscv_vand_vx_u8m1 (varr_3, 1, 32); [return slot optim= ization] > > vmask_5 =3D __riscv_vreinterpret_v_u8m1_b8 (vand_m_4); [return slot > > optimization] > > =3D vmask_5; > > arr =3D{v} {CLOBBER(eol)}; > > return ; > >=20 > > and on RTL I see lots of UNSPECs, RTL opts cannot do anything with thos= e. > >=20 > > This is what Andrew said already. >=20 > Ok. I wonder why this issue is gone when I change it into: >=20 > arr as static >=20 > https://godbolt.org/z/Tdoshdfr6 Because the stacik initialization isn't required then.=