From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A9753857C5B; Tue, 13 Feb 2024 22:54:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A9753857C5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707864855; bh=QK2PlErsi2fO4f7nkoeFFNu6loJgxiyTRy4mvgJ8W9o=; h=From:To:Subject:Date:In-Reply-To:References:From; b=m0sEwiJk7CzMWE5jGrDMmsEXwfTJrEnoXBcuuJMVVCKIAu+1nzsQaW8aYQjd4mI76 9qyPS5Z5OyzJztgywkkgS11RT2h94E5GM5DwExeEUOUKMYX9gnMok+1IBOrlvAD7YL 7QjjSKRSuqTLcU599I7ckBYqIJHfcCw5If5rAb94= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113913] [14] RISC-V: suboptimal code gen for intrinsic vcreate Date: Tue, 13 Feb 2024 22:54:14 +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, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: everconfirmed bug_status cf_reconfirmed_on keywords 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=3D113913 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2024-02-13 Keywords| |ra --- Comment #1 from Andrew Pinski --- This looks like a subreg issue: ``` (insn 18 17 8 2 (set (reg:RVVM2SF 134 [ ]) (if_then_else:RVVM2SF (unspec:RVVMF16BI [ (const_vector:RVVMF16BI repeat [ (const_int 1 [0x1]) ]) (reg:DI 138) (const_int 2 [0x2]) repeated x2 (const_int 1 [0x1]) (reg:SI 66 vl) (reg:SI 67 vtype) ] UNSPEC_VPREDICATE) (const_vector:RVVM2SF repeat [ (const_double:SF 0.0 [0x0.0p+0]) ]) (unspec:RVVM2SF [ (reg:DI 0 zero) ] UNSPEC_VUNDEF))) "/app/example.c":12:10 3943 {*pred_broadcastrvvm2sf_imm} (expr_list:REG_DEAD (reg:DI 138) (expr_list:REG_DEAD (reg:SI 67 vtype) (expr_list:REG_DEAD (reg:SI 66 vl) (expr_list:REG_DEAD (reg:DI 0 zero) (expr_list:REG_EQUAL (const_vector:RVVM2SF repeat [ (const_double:SF 0.0 [0x0.0p+0]) ]) (nil))))))) (insn 8 18 9 2 (set (subreg:RVVM1SF (reg:RVVM2SF 134 [ ]) 0) (reg:RVVM1SF 139)) "/app/example.c":12:10 2591 {*movrvvm1sf_whole} (expr_list:REG_DEAD (reg:RVVM1SF 139) (nil))) (insn 9 8 13 2 (set (subreg:RVVM1SF (reg:RVVM2SF 134 [ ]) [16, 16]) (reg:RVVM1SF 140)) "/app/example.c":12:10 2591 {*movrvvm1sf_whole} (expr_list:REG_DEAD (reg:RVVM1SF 140) (nil))) ``` Confirmed. There are others like this too. Though I wonder if we emit: (clobber (reg:RVVM2SF 134 [ ])) When expanding __riscv_vcreate_v_f32m1_f32m2 and friends. If that might hel= p. The other thing is init-reg gets in the way and adds: ``` (insn 17 16 18 2 (set (reg:DI 138) (unspec:DI [ (const_int 8 [0x8]) ] UNSPEC_VLMAX)) "/app/example.c":6:10 -1 (nil)) (insn 18 17 8 2 (set (reg:RVVM2HF 134 [ ]) (if_then_else:RVVM2HF (unspec:RVVMF8BI [ (const_vector:RVVMF8BI repeat [ (const_int 1 [0x1]) ]) (reg:DI 138) (const_int 2 [0x2]) repeated x2 (const_int 1 [0x1]) (reg:SI 66 vl) (reg:SI 67 vtype) ] UNSPEC_VPREDICATE) (const_vector:RVVM2HF repeat [ (const_double:HF 0.0 [0x0.0p+0]) ]) (unspec:RVVM2HF [ (reg:DI 0 zero) ] UNSPEC_VUNDEF))) "/app/example.c":6:10 -1 (expr_list:REG_EQUAL (const_vector:RVVM2HF repeat [ (const_double:HF 0.0 [0x0.0p+0]) ]) (nil))) ```=