From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E0CA3858D32; Thu, 28 Dec 2023 03:55:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E0CA3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703735717; bh=UMX4e8cikcKE5FDOlzj/uCLvljlDMM6UE4w0itbCNfo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GCQ6V2/5tYrQJVKIqRO+aNKYlr7u1fN6eP8/rqWHc0oR4GZv2LnJtSC5XOKsYklbQ Mc4J22nX7533YNJBlIlJZfngEE6MTNukkRZP1ZBPbJr+kBNsRPdoU95gNNkftW3s8C C/zGUWZFE5wAmR4KWvnPWElhv4IN9aRKb5XLW6Ok= From: "juzhe.zhong at rivai dot ai" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/113134] gcc does not version loops with early break conditions that don't have side-effects Date: Thu, 28 Dec 2023 03:55:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: juzhe.zhong at rivai dot ai 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=3D113134 --- Comment #5 from JuzheZhong --- (In reply to Tamar Christina from comment #4) > (In reply to JuzheZhong from comment #3) > > I guess this code is just disabling partial vector for length for now. > >=20 > > And need me to test and port this part for length in the followup patch= es. > >=20 > > Am I right ? >=20 > Yeah, it needed to safely not allow it through for now. Once implemented= =20 > you'll hit an assert in vectorizable_live_operations where you need to > provide a way to also get the first active element from a vector. So for a length target, I enable cbranch optab but no vcond_mask_len optab. Will it behavior wrong ? Another question is could you give me more hints about vectorizable_live_operation? I thought vectorizable_live_operation is doing extract last active element, I didn't see extract first active element.=