From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE5C73858D38; Mon, 22 Apr 2024 11:52:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE5C73858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713786768; bh=U8lo9aDM6TwFJWAiyeMQ95hMid6tolFLFWBFte1K4Os=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yIZt/u5gYfKFQmWlVl2GiWKBMJ5/sAh8B48CKl+vEHsqJ3jjwuDg8eEcD8DUvOmMY zaW13+tTCmLdwftROhyNxnF56Iopmz4zze7kjZGnTMo/G2lOcMGs/2ziW1+SYzSdvI a3WjoB3hwUsMjAnfnP4JhrOC17xuxxfQd+V5xOSY= From: "liuhongt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/85048] [missed optimization] vector conversions Date: Mon, 22 Apr 2024 11:52:47 +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: 8.0.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: liuhongt 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: 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=3D85048 --- Comment #16 from Hongtao Liu --- (In reply to Matthias Kretz (Vir) from comment #15) > So it seems that if at least one of the vector builtins involved in the > expression is 512 bits GCC needs to locally increase prefer-vector-width = to > 512? Or, more generally: >=20 > prefer-vector-width =3D max(prefer-vector-width, 8 * sizeof(operands)...,= 8 * > sizeof(return-value)) >=20 > The reason to default to 256 bits is to avoid zmm register usage altogeth= er > (clock-down). But if the surrounding code already uses zmm registers that > motivation is moot. >=20 > Also, I think this shouldn't be considered auto-vectorization but rather > pattern recognition (recognizing a __builtin_convertvector). The related question is "should GCC set prefer-vector-width=3D512" when 512= -bit intrinsics is used. There may be a situation where users don't want compile= r to generate zmm except for those 512-bit intrinsics in their program, i.e the = hot loop is written with 512-bit intrinsics for performance purpose, but for ot= her places, better no zmm usage.=