From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2C23E3858432; Wed, 17 Jan 2024 21:08:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C23E3858432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705525729; bh=Fli4kkVVRKJOr0yvHn1IcjIzQqYbaEvZs/f+9uF8b34=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HFRBCgfZaRdyNHBWPYHiDumjSUTpE/vSdcsbtSisHscWvV/L5MnYWPfFn1bpvU76j FVN7LlI71b5cywu1pSv7mH/NsEx5q2sSMeuCCtFBGGGTGRMmybzMBLVFOmb20goLIE gBKcpXSivC+voEgbN4EC7sGjrhXWoPN/E8MdiIUU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113458] Missed SLP for reduction of multiplication/addition with promotion Date: Wed, 17 Jan 2024 21:08:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement 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=3D113458 --- Comment #1 from Andrew Pinski --- The loop based vectorizer is able to do a decent job at: ``` int f(short *a, signed char *b, int n) { int sum =3D 0; n =3D 8; for(int i =3D 0;i < n; i++) sum +=3D a[i]*b[i]; return sum; } ``` But if we reduce n to 4, the loop based vectorizer is not able to handle it either.=