From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 38BDA3858C66; Tue, 1 Aug 2023 09:09:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 38BDA3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690880997; bh=ZHD9CJUNURUCs/gdGcdl+kDMgpCRMZuMavaHEzjNaS0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DuYMhH12rqHCnNeCPQ/oCGWjwbOP5XPUihdfiqZDrmnxCnWudxuuPqk7dSTfSBbIg D5+4tKzG4JZnW9LcAevYLMvh4KMT6qRZ/mOUTfzEqIapL0cP1SvIG7hc55TFww/dmU kzV+Spm8MpgblVemb1FOc7aJ7PBBPCJOJJVEn2g4= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110625] [AArch64] Vect: SLP fails to vectorize a loop as the reduction_latency calculated by new costs is too large Date: Tue, 01 Aug 2023 09:09:33 +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 X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rsandifo at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D110625 Tamar Christina changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tnfchris at gcc dot gnu.org --- Comment #13 from Tamar Christina --- Hi, This patch is causing several ICEs: For instance in x264, during GIMPLE pass: vect x264_src/common/pixel.c: In function 'x264_pixel_satd_8x4.constprop': x264_src/common/pixel.c:234:21: internal compiler error: in info_for_reduct= ion, at tree-vect-loop.cc:5473 234 | static NOINLINE int x264_pixel_satd_8x4( uint8_t *pix1, int i_pix1, uint8_t *pix2, int i_pix2 ) | ^ 0xe45e23 info_for_reduction(vec_info*, _stmt_vec_info*) /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:5473 0xf1e317 aarch64_force_single_cycle =20=20=20=20=20=20=20 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/config/aarch64/aarch64.cc:16782 0xf1e317 aarch64_vector_costs::count_ops(unsigned int, vect_cost_for_stmt, _stmt_vec_info*, aarch64_vec_op_count*) =20=20=20=20=20=20=20 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/config/aarch64/aarch64.cc:16807 0xf31fbb aarch64_vector_costs::add_stmt_cost(int, vect_cost_for_stmt, _stmt_vec_info*, _slp_tree*, tree_node*, int, vect_cost_model_location) =20=20=20=20=20=20=20 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/config/aarch64/aarch64.cc:17074 0xe59edb add_stmt_cost(vector_costs*, int, vect_cost_for_stmt, _stmt_vec_in= fo*, _slp_tree*, tree_node*, int, vect_cost_model_location) /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vectorizer.h:1823 0xe59edb add_stmt_costs(vector_costs*, vec*) /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vectorizer.h:1870 0xe59edb vect_compute_single_scalar_iteration_cost /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:1624 0xe59edb vect_analyze_loop_2 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:2710 0xe5bb07 vect_analyze_loop_1 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:3329 0xe5c1cb vect_analyze_loop(loop*, vec_info_shared*) /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vect-loop.cc:3483 0xe90797 try_vectorize_loop_1 /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vectorizer.cc:1064 0xe90797 try_vectorize_loop /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vectorizer.cc:1180 0xe90cb3 execute /opt/buildAgent/work/5c94c4ced6ebfcd0/gcc/tree-vectorizer.cc:1296 This seems to be caused because in aarch64_force_single_cycle is unconditionally calling info_for_reduction without checking to see if this = stmt is actually a reduction. You'll want to check STMT_VINFO_REDUC_DEF or STMT_VINFO_DEF_TYPE before cal= ling this.=