From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 54FCF385770B; Thu, 2 Nov 2023 13:59:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54FCF385770B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698933550; bh=iDjOShHJ4e3ebYi5QwFao0KFzUeRaSF/TDY9EABeORA=; h=From:To:Subject:Date:From; b=R3z3rY+bW+Zgwb6YUUapX/NZahQdiWWDGMyZU8N9nBdat4cDL0NLdRhbDrx+tYNMr QMkkVV+wb727egu8QhRtH/sXkbcdicKXkJO86+xXZk4dajSQmsHDboQdKfv45EjNY7 AyZYn/upyLLA6McknnrnmyZmsYsYNT8M8QDWUTpM= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/rguenth/heads/vect-force-slp)] Fail vectorization when not SLP with --param vect-force-slp=1 X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/users/rguenth/heads/vect-force-slp X-Git-Oldrev: c71028c979d55f98b7727f9387bbe2f4ffe6de13 X-Git-Newrev: b4cc3c4df162551cc26a69a656d75e7f14791ff0 Message-Id: <20231102135910.54FCF385770B@sourceware.org> Date: Thu, 2 Nov 2023 13:59:10 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b4cc3c4df162551cc26a69a656d75e7f14791ff0 commit b4cc3c4df162551cc26a69a656d75e7f14791ff0 Author: Richard Biener Date: Wed Aug 23 10:48:32 2023 +0200 Fail vectorization when not SLP with --param vect-force-slp=1 The following adds --param vect-force-slp allowing to indicate failure when not all stmts participating in loop vectorization are using SLP vectorization. This is intended for transitioning and debugging. Enabling this without further changes results in the following within vect.exp on x86_64 === g++ Summary === -# of expected passes 619 +# of expected passes 546 +# of unexpected failures 73 === gcc Summary === -# of expected passes 8835 -# of expected failures 256 +# of expected passes 7271 +# of unexpected failures 1564 +# of unexpected successes 12 +# of expected failures 244 === gfortran Summary === -# of expected passes 171 +# of expected passes 144 +# of unexpected failures 27 * params.opt (-param=vect-force-slp=): New, default to 0. * doc/invoke.texi (--param vect-force-slp): Document. * tree-vect-stmts.cc (vect_analyze_stmt): With --param vect-force-slp=1 fail vectorization when not using SLP. Diff: --- gcc/doc/invoke.texi | 4 ++++ gcc/params.opt | 4 ++++ gcc/tree-vect-stmts.cc | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 6e776a0faa19..84b60c4c2508 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -16336,6 +16336,10 @@ this parameter. The default value of this parameter is 50. @item vect-induction-float Enable loop vectorization of floating point inductions. +@item vect-force-slp +Fail vectorization when falling back to non-SLP. This is intended for +debugging only. + @item vrp-sparse-threshold Maximum number of basic blocks before VRP uses a sparse bitmap cache. diff --git a/gcc/params.opt b/gcc/params.opt index f1202abc00d0..d0b7a6d770b0 100644 --- a/gcc/params.opt +++ b/gcc/params.opt @@ -1191,6 +1191,10 @@ The maximum factor which the loop vectorizer applies to the cost of statements i Common Joined UInteger Var(param_vect_induction_float) Init(1) IntegerRange(0, 1) Param Optimization Enable loop vectorization of floating point inductions. +-param=vect-force-slp= +Common Joined UInteger Var(param_vect_force_slp) Init(0) IntegerRange(0, 1) Param Optimization +Fail vectorization when falling back to non-SLP. + -param=vrp-sparse-threshold= Common Joined UInteger Var(param_vrp_sparse_threshold) Init(3000) Optimization Param Maximum number of basic blocks before VRP uses a sparse bitmap cache. diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 799b4ab10c7f..74daf0f2d45b 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -12896,6 +12896,12 @@ vect_analyze_stmt (vec_info *vinfo, return opt_result::success (); } + if (param_vect_force_slp && !node) + return opt_result::failure_at (stmt_info->stmt, + "not vectorized:" + " not part of SLP but SLP forced: %G", + stmt_info->stmt); + ok = true; if (!bb_vinfo && (STMT_VINFO_RELEVANT_P (stmt_info)