From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0A7593858D38; Mon, 22 Apr 2024 08:21:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A7593858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713774069; bh=xlN14Po/Dpa9d39p5vf2738kEFcUFEODv5tyu5xqrzU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uK1CjRlBRxsbnXifUo4JHtQiXiu/Rct4NYM4taxdheJLkvXLCQ/pIsCYGTolkgeo6 /kMJ7uZ0xMbJ+nAfNVQMvUYNQQOJbJWafSe6l6bocu/SJTLc7so1S7bC3owP/HjlAN MUzmFOsKfNcPRyN5DA9++fJfrnWQ16DkcLEJC8NE= From: "mkretz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/85048] [missed optimization] vector conversions Date: Mon, 22 Apr 2024 08:21:07 +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: mkretz 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 #15 from Matthias Kretz (Vir) --- 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: prefer-vector-width =3D max(prefer-vector-width, 8 * sizeof(operands)..., 8= * sizeof(return-value)) The reason to default to 256 bits is to avoid zmm register usage altogether (clock-down). But if the surrounding code already uses zmm registers that motivation is moot. Also, I think this shouldn't be considered auto-vectorization but rather pattern recognition (recognizing a __builtin_convertvector).=