From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by sourceware.org (Postfix) with ESMTPS id 2E738385841D for ; Tue, 28 May 2024 09:43:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E738385841D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2E738385841D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::134 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716889429; cv=none; b=IsCNVG0NujJPX1EfREJDSeZES95jVPuiYxMfR5chj4bQg2dhiZzjCR69MuI1Lee8gHPOD9FCCmz7RdfSTMtv/7twvIDdecNW14Y7JXsLhll/dor15T5migkA3PgfLFst9+GdRKKgZaLCiw+SfjuAHUD0+u/Qy1Fz2USNuCZMpq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716889429; c=relaxed/simple; bh=Hfayg4dPMpE8D7Wfu11F7lvlSrM3uUnVPwQezXR5AOk=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Ngel53ZQ4vEUzMXwNyrXA57bu8FTwYCsilZZ5gGy5pEfyagkykg8Iqgn0Nf5TrCwDBG4BPKiYVvLgEABRU/Na/QWKPUM2AmYS9Pt0+GGCZAbVbxOWGb2Ku2mTO3ILXZJIDRLcUon4VogjypjpeUqzgJk5mJaqI9N3/4d6y0WkUY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-5238b7d0494so752319e87.3 for ; Tue, 28 May 2024 02:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716889425; x=1717494225; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7ER4BTC+UeNw0TdF1QIcYG+3Qxy1mCfT2LLYRSdZk+Q=; b=IlQ80nuinZDL7yDKSqsBERjUriR6krjgA9YrS7nS1WVRIH2sCe7DxWW3f30GopDfTG 5D/weFdW3+jNm4ciA8CopburSivqGsWKNHL+Tg5v/7rQynos8bL86h1JGUNgRb1PAu48 dkSRmhwB9f5uy+KA9TF6Vaa/hqDdvmVVrucFX4+yfmy6uH7xH8VTtdsqTPcmOY+AAv+O ipvK1zwIvwPF6jxN1oDOn1Mqk59a7AM8kqubNLSHYNfM4YZlwln0W0rQsNGaQ+O3xiya ytFEKZfCd0xaRxpTzOIE9PF+tjR3GVQKqaPBvYSoU6rV1a3oq27mS0oABSS2GuYIfXcU eGOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716889425; x=1717494225; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7ER4BTC+UeNw0TdF1QIcYG+3Qxy1mCfT2LLYRSdZk+Q=; b=LKM+Sv+Sq0Y48u6tx0qs+OhMN2k9QTO5YS65K1sqAfuq8R5bBAQbB18OoVFkCdUTdA eG4XHBUilyPowvuK/k3c0vuQ2uB5x34h4agFHESzOqhmOLyMyKTmQJwR1uLZs4/sOTpY HQPPg9TDeDMFmaQJLHcjjNt6x+C3AJG5tjWHOG+so9AMOLsims8T6YDTO9/EFFgplJrT b5j9ldW+fhCJQg2ZGQpw9RzUb5gUWQyp/TrE2iEL4xyI/HQ/uMAdQOcs9nGy0cyH1Cml v6BU66T74iS4iGG6VepuAXedqO1IjUOtGh0BuPRILrDuyjGI9AEYso3kXY+tL1pHoERu rQdw== X-Gm-Message-State: AOJu0YxIVUvbfd9rqjb7Zs4+KU2+dvos1i75cpzq4xD84gnsOAyFyL9x j4JKnvTfOU/c2eV3G9sO6tfEx7dg/opUPQcjuOO9NHPcHUFytnnIyRh33EL7Q7CIw27+8s2PYGp RKaFvbP4bxKsh1acYBI//XwpWSMk= X-Google-Smtp-Source: AGHT+IHoQtmCAiHn5/EwP/DNr2ConV0RSuGGwLoe73JtAR9cLetRytuHYl3pltQzyXTCFquBELgkPWk3VKRlVpzmPKU= X-Received: by 2002:a05:6512:52f:b0:523:a7f0:a087 with SMTP id 2adb3069b0e04-52965c2f882mr10980398e87.34.1716889424103; Tue, 28 May 2024 02:43:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Tue, 28 May 2024 11:43:33 +0200 Message-ID: Subject: Re: [PATCH] vect: Unify bbs in loop_vec_info and bb_vec_info To: Feng Xue OS Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, May 25, 2024 at 4:54=E2=80=AFPM Feng Xue OS wrote: > > Both derived classes ( loop_vec_info/bb_vec_info) have their own "bbs" > field, which have exactly same purpose of recording all basic blocks > inside the corresponding vect region, while the fields are composed by > different data type, one is normal array, the other is auto_vec. This > difference causes some duplicated code even handling the same stuff, > almost in tree-vect-patterns. One refinement is lifting this field into t= he > base class "vec_info", and reset its value to the continuous memory area > pointed by two old "bbs" in each constructor of derived classes. Nice. But. bbs_as_vector - why is that necessary? Why is vinfo->bbs not a vec? Having bbs and nbbs feels like a step back. Note the code duplications can probably be removed by "indirecting" through an array_slice. I'm a bit torn to approve this as-is given the above. Can you explain what made you not choose vec<> for bbs? I bet you tried. Richard. > Regression test on x86-64 and aarch64. > > Feng > -- > gcc/ > * tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Move > initialization of bbs to explicit construction code. Adjust the > definition of nbbs. > * tree-vect-pattern.cc (vect_determine_precisions): Make > loop_vec_info and bb_vec_info share same code. > (vect_pattern_recog): Remove duplicated vect_pattern_recog_1 loop= . > * tree-vect-slp.cc (vect_get_and_check_slp_defs): Access to bbs[0= ] > via base vec_info class. > (_bb_vec_info::_bb_vec_info): Initialize bbs and nbbs using data > fields of input auto_vec<> bbs. > (_bb_vec_info::_bb_vec_info): Add assertions on bbs and nbbs to e= nsure > they are not changed externally. > (vect_slp_region): Use access to nbbs to replace original > bbs.length(). > (vect_schedule_slp_node): Access to bbs[0] via base vec_info clas= s. > * tree-vectorizer.cc (vec_info::vec_info): Add initialization of > bbs and nbbs. > (vec_info::insert_seq_on_entry): Access to bbs[0] via base vec_in= fo > class. > * tree-vectorizer.h (vec_info): Add new fields bbs and nbbs. > (_loop_vec_info): Remove field bbs. > (_bb_vec_info): Rename old bbs field to bbs_as_vector, and make i= t > be private. > --- > gcc/tree-vect-loop.cc | 6 +- > gcc/tree-vect-patterns.cc | 142 +++++++++++--------------------------- > gcc/tree-vect-slp.cc | 24 ++++--- > gcc/tree-vectorizer.cc | 7 +- > gcc/tree-vectorizer.h | 19 ++--- > 5 files changed, 72 insertions(+), 126 deletions(-) > > diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc > index 83c0544b6aa..aef17420a5f 100644 > --- a/gcc/tree-vect-loop.cc > +++ b/gcc/tree-vect-loop.cc > @@ -1028,7 +1028,6 @@ bb_in_loop_p (const_basic_block bb, const void *dat= a) > _loop_vec_info::_loop_vec_info (class loop *loop_in, vec_info_shared *sh= ared) > : vec_info (vec_info::loop, shared), > loop (loop_in), > - bbs (XCNEWVEC (basic_block, loop->num_nodes)), > num_itersm1 (NULL_TREE), > num_iters (NULL_TREE), > num_iters_unchanged (NULL_TREE), > @@ -1079,8 +1078,9 @@ _loop_vec_info::_loop_vec_info (class loop *loop_in= , vec_info_shared *shared) > case of the loop forms we allow, a dfs order of the BBs would the s= ame > as reversed postorder traversal, so we are safe. */ > > - unsigned int nbbs =3D dfs_enumerate_from (loop->header, 0, bb_in_loop_= p, > - bbs, loop->num_nodes, loop); > + bbs =3D XCNEWVEC (basic_block, loop->num_nodes); > + nbbs =3D dfs_enumerate_from (loop->header, 0, bb_in_loop_p, bbs, > + loop->num_nodes, loop); > gcc_assert (nbbs =3D=3D loop->num_nodes); > > for (unsigned int i =3D 0; i < nbbs; i++) > diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc > index a313dc64643..848a3195a93 100644 > --- a/gcc/tree-vect-patterns.cc > +++ b/gcc/tree-vect-patterns.cc > @@ -6925,81 +6925,41 @@ vect_determine_stmt_precisions (vec_info *vinfo, = stmt_vec_info stmt_info) > void > vect_determine_precisions (vec_info *vinfo) > { > + basic_block *bbs =3D vinfo->bbs; > + unsigned int nbbs =3D vinfo->nbbs; > + > DUMP_VECT_SCOPE ("vect_determine_precisions"); > > - if (loop_vec_info loop_vinfo =3D dyn_cast (vinfo)) > + for (unsigned int i =3D 0; i < nbbs; i++) > { > - class loop *loop =3D LOOP_VINFO_LOOP (loop_vinfo); > - basic_block *bbs =3D LOOP_VINFO_BBS (loop_vinfo); > - unsigned int nbbs =3D loop->num_nodes; > - > - for (unsigned int i =3D 0; i < nbbs; i++) > + basic_block bb =3D bbs[i]; > + for (auto gsi =3D gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next = (&gsi)) > { > - basic_block bb =3D bbs[i]; > - for (auto gsi =3D gsi_start_phis (bb); > - !gsi_end_p (gsi); gsi_next (&gsi)) > - { > - stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi.phi ())= ; > - if (stmt_info) > - vect_determine_mask_precision (vinfo, stmt_info); > - } > - for (auto si =3D gsi_start_bb (bb); !gsi_end_p (si); gsi_next (= &si)) > - if (!is_gimple_debug (gsi_stmt (si))) > - vect_determine_mask_precision > - (vinfo, vinfo->lookup_stmt (gsi_stmt (si))); > + stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi.phi ()); > + if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) > + vect_determine_mask_precision (vinfo, stmt_info); > } > - for (unsigned int i =3D 0; i < nbbs; i++) > + for (auto gsi =3D gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&= gsi)) > { > - basic_block bb =3D bbs[nbbs - i - 1]; > - for (gimple_stmt_iterator si =3D gsi_last_bb (bb); > - !gsi_end_p (si); gsi_prev (&si)) > - if (!is_gimple_debug (gsi_stmt (si))) > - vect_determine_stmt_precisions > - (vinfo, vinfo->lookup_stmt (gsi_stmt (si))); > - for (auto gsi =3D gsi_start_phis (bb); > - !gsi_end_p (gsi); gsi_next (&gsi)) > - { > - stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi.phi ())= ; > - if (stmt_info) > - vect_determine_stmt_precisions (vinfo, stmt_info); > - } > + stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi_stmt (gsi))= ; > + if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) > + vect_determine_mask_precision (vinfo, stmt_info); > } > } > - else > + for (unsigned int i =3D 0; i < nbbs; i++) > { > - bb_vec_info bb_vinfo =3D as_a (vinfo); > - for (unsigned i =3D 0; i < bb_vinfo->bbs.length (); ++i) > + basic_block bb =3D bbs[nbbs - i - 1]; > + for (auto gsi =3D gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&g= si)) > { > - basic_block bb =3D bb_vinfo->bbs[i]; > - for (auto gsi =3D gsi_start_phis (bb); !gsi_end_p (gsi); gsi_ne= xt (&gsi)) > - { > - stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi.phi ())= ; > - if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) > - vect_determine_mask_precision (vinfo, stmt_info); > - } > - for (auto gsi =3D gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next= (&gsi)) > - { > - stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi_stmt (g= si)); > - if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) > - vect_determine_mask_precision (vinfo, stmt_info); > - } > + stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi_stmt (gsi))= ; > + if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) > + vect_determine_stmt_precisions (vinfo, stmt_info); > } > - for (int i =3D bb_vinfo->bbs.length () - 1; i !=3D -1; --i) > + for (auto gsi =3D gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next = (&gsi)) > { > - for (gimple_stmt_iterator gsi =3D gsi_last_bb (bb_vinfo->bbs[i]= ); > - !gsi_end_p (gsi); gsi_prev (&gsi)) > - { > - stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi_stmt (g= si)); > - if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) > - vect_determine_stmt_precisions (vinfo, stmt_info); > - } > - for (auto gsi =3D gsi_start_phis (bb_vinfo->bbs[i]); > - !gsi_end_p (gsi); gsi_next (&gsi)) > - { > - stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi.phi ())= ; > - if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) > - vect_determine_stmt_precisions (vinfo, stmt_info); > - } > + stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi.phi ()); > + if (stmt_info && STMT_VINFO_VECTORIZABLE (stmt_info)) > + vect_determine_stmt_precisions (vinfo, stmt_info); > } > } > } > @@ -7328,56 +7288,32 @@ vect_pattern_recog_1 (vec_info *vinfo, > void > vect_pattern_recog (vec_info *vinfo) > { > - class loop *loop; > - basic_block *bbs; > - unsigned int nbbs; > - gimple_stmt_iterator si; > - unsigned int i, j; > + basic_block *bbs =3D vinfo->bbs; > + unsigned int nbbs =3D vinfo->nbbs; > > vect_determine_precisions (vinfo); > > DUMP_VECT_SCOPE ("vect_pattern_recog"); > > - if (loop_vec_info loop_vinfo =3D dyn_cast (vinfo)) > + /* Scan through the stmts in the region, applying the pattern recognit= ion > + functions starting at each stmt visited. */ > + for (unsigned i =3D 0; i < nbbs; i++) > { > - loop =3D LOOP_VINFO_LOOP (loop_vinfo); > - bbs =3D LOOP_VINFO_BBS (loop_vinfo); > - nbbs =3D loop->num_nodes; > + basic_block bb =3D bbs[i]; > > - /* Scan through the loop stmts, applying the pattern recognition > - functions starting at each stmt visited: */ > - for (i =3D 0; i < nbbs; i++) > + for (auto si =3D gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si= )) > { > - basic_block bb =3D bbs[i]; > - for (si =3D gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si)) > - { > - if (is_gimple_debug (gsi_stmt (si))) > - continue; > - stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi_stmt (s= i)); > - /* Scan over all generic vect_recog_xxx_pattern functions. = */ > - for (j =3D 0; j < NUM_PATTERNS; j++) > - vect_pattern_recog_1 (vinfo, &vect_vect_recog_func_ptrs[j= ], > - stmt_info); > - } > + stmt_vec_info stmt_info =3D vinfo->lookup_stmt (gsi_stmt (si)); > + > + if (!stmt_info || !STMT_VINFO_VECTORIZABLE (stmt_info)) > + continue; > + > + /* Scan over all generic vect_recog_xxx_pattern functions. */ > + for (unsigned j =3D 0; j < NUM_PATTERNS; j++) > + vect_pattern_recog_1 (vinfo, &vect_vect_recog_func_ptrs[j], > + stmt_info); > } > } > - else > - { > - bb_vec_info bb_vinfo =3D as_a (vinfo); > - for (unsigned i =3D 0; i < bb_vinfo->bbs.length (); ++i) > - for (gimple_stmt_iterator gsi =3D gsi_start_bb (bb_vinfo->bbs[i])= ; > - !gsi_end_p (gsi); gsi_next (&gsi)) > - { > - stmt_vec_info stmt_info =3D bb_vinfo->lookup_stmt (gsi_stmt (= gsi)); > - if (!stmt_info || !STMT_VINFO_VECTORIZABLE (stmt_info)) > - continue; > - > - /* Scan over all generic vect_recog_xxx_pattern functions. *= / > - for (j =3D 0; j < NUM_PATTERNS; j++) > - vect_pattern_recog_1 (vinfo, > - &vect_vect_recog_func_ptrs[j], stmt_i= nfo); > - } > - } > > /* After this no more add_stmt calls are allowed. */ > vinfo->stmt_vec_info_ro =3D true; > diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc > index c7ed520b629..2e0244cf582 100644 > --- a/gcc/tree-vect-slp.cc > +++ b/gcc/tree-vect-slp.cc > @@ -748,8 +748,7 @@ vect_get_and_check_slp_defs (vec_info *vinfo, unsigne= d char swap, > && is_a (vinfo) > && TREE_CODE (oprnd) =3D=3D SSA_NAME > && !SSA_NAME_IS_DEFAULT_DEF (oprnd) > - && !dominated_by_p (CDI_DOMINATORS, > - as_a (vinfo)->bbs[0], > + && !dominated_by_p (CDI_DOMINATORS, vinfo->bbs[0], > gimple_bb (SSA_NAME_DEF_STMT (oprnd)))) > { > if (dump_enabled_p ()) > @@ -6288,10 +6287,13 @@ vect_detect_hybrid_slp (loop_vec_info loop_vinfo) > > _bb_vec_info::_bb_vec_info (vec _bbs, vec_info_shared *shar= ed) > : vec_info (vec_info::bb, shared), > - bbs (_bbs), > + bbs_as_vector (_bbs), > roots (vNULL) > { > - for (unsigned i =3D 0; i < bbs.length (); ++i) > + bbs =3D bbs_as_vector.address (); > + nbbs =3D bbs_as_vector.length (); > + > + for (unsigned i =3D 0; i < nbbs; ++i) > { > if (i !=3D 0) > for (gphi_iterator si =3D gsi_start_phis (bbs[i]); !gsi_end_p (si= ); > @@ -6319,8 +6321,12 @@ _bb_vec_info::_bb_vec_info (vec _bbs,= vec_info_shared *shared) > > _bb_vec_info::~_bb_vec_info () > { > + /* Check that bbs stored in the vector is not changed externally. */ > + gcc_assert (bbs =3D=3D bbs_as_vector.address ()); > + gcc_assert (nbbs =3D bbs_as_vector.length ()); > + > /* Reset region marker. */ > - for (unsigned i =3D 0; i < bbs.length (); ++i) > + for (unsigned i =3D 0; i < nbbs; ++i) > { > if (i !=3D 0) > for (gphi_iterator si =3D gsi_start_phis (bbs[i]); !gsi_end_p (si= ); > @@ -7625,7 +7631,7 @@ vect_slp_is_lane_insert (gimple *use_stmt, tree vec= , unsigned *this_lane) > static void > vect_slp_check_for_roots (bb_vec_info bb_vinfo) > { > - for (unsigned i =3D 0; i < bb_vinfo->bbs.length (); ++i) > + for (unsigned i =3D 0; i < bb_vinfo->nbbs; ++i) > for (gimple_stmt_iterator gsi =3D gsi_start_bb (bb_vinfo->bbs[i]); > !gsi_end_p (gsi); gsi_next (&gsi)) > { > @@ -8109,7 +8115,7 @@ vect_slp_region (vec bbs, vec datarefs, > we vectorized all if-converted code. */ > if ((!profitable_subgraphs.is_empty () || force_clear) && orig_= loop) > { > - gcc_assert (bb_vinfo->bbs.length () =3D=3D 1); > + gcc_assert (bb_vinfo->nbbs =3D=3D 1); > for (gimple_stmt_iterator gsi =3D gsi_start_bb (bb_vinfo->b= bs[0]); > !gsi_end_p (gsi); gsi_next (&gsi)) > { > @@ -9613,14 +9619,14 @@ vect_schedule_slp_node (vec_info *vinfo, > if (!last_stmt) > { > gcc_assert (seen_vector_def); > - si =3D gsi_after_labels (as_a (vinfo)->bbs[0]); > + si =3D gsi_after_labels (vinfo->bbs[0]); > } > else if (is_ctrl_altering_stmt (last_stmt)) > { > /* We split regions to vectorize at control altering stmts > with a definition so this must be an external which > we can insert at the start of the region. */ > - si =3D gsi_after_labels (as_a (vinfo)->bbs[0]); > + si =3D gsi_after_labels (vinfo->bbs[0]); > } > else if (is_a (vinfo) > && gimple_bb (last_stmt) !=3D gimple_bb (stmt_info->stmt) > diff --git a/gcc/tree-vectorizer.cc b/gcc/tree-vectorizer.cc > index 9001b738bf3..1fb4fb36ed4 100644 > --- a/gcc/tree-vectorizer.cc > +++ b/gcc/tree-vectorizer.cc > @@ -463,7 +463,9 @@ shrink_simd_arrays > vec_info::vec_info (vec_info::vec_kind kind_in, vec_info_shared *shared_= ) > : kind (kind_in), > shared (shared_), > - stmt_vec_info_ro (false) > + stmt_vec_info_ro (false), > + bbs (NULL), > + nbbs (0) > { > stmt_vec_infos.create (50); > } > @@ -660,9 +662,8 @@ vec_info::insert_seq_on_entry (stmt_vec_info context,= gimple_seq seq) > } > else > { > - bb_vec_info bb_vinfo =3D as_a (this); > gimple_stmt_iterator gsi_region_begin > - =3D gsi_after_labels (bb_vinfo->bbs[0]); > + =3D gsi_after_labels (bbs[0]); > gsi_insert_seq_before (&gsi_region_begin, seq, GSI_SAME_STMT); > } > } > diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h > index 93bc30ef660..ffc2b223dd2 100644 > --- a/gcc/tree-vectorizer.h > +++ b/gcc/tree-vectorizer.h > @@ -499,6 +499,12 @@ public: > made any decisions about which vector modes to use. */ > machine_mode vector_mode; > > + /* The basic blocks in the vectorization region. */ > + basic_block *bbs; > + > + /* The count of the basic blocks in the vectorization region. */ > + unsigned int nbbs; > + > private: > stmt_vec_info new_stmt_vec_info (gimple *stmt); > void set_vinfo_for_stmt (gimple *, stmt_vec_info, bool =3D true); > @@ -679,9 +685,6 @@ public: > /* The loop to which this info struct refers to. */ > class loop *loop; > > - /* The loop basic blocks. */ > - basic_block *bbs; > - > /* Number of latch executions. */ > tree num_itersm1; > /* Number of iterations. */ > @@ -1090,15 +1093,15 @@ struct slp_root > > typedef class _bb_vec_info : public vec_info > { > -public: > - _bb_vec_info (vec bbs, vec_info_shared *); > - ~_bb_vec_info (); > - > /* The region we are operating on. bbs[0] is the entry, excluding > its PHI nodes. In the future we might want to track an explicit > entry edge to cover bbs[0] PHI nodes and have a region entry > insert location. */ > - vec bbs; > + vec bbs_as_vector; > + > +public: > + _bb_vec_info (vec bbs, vec_info_shared *); > + ~_bb_vec_info (); > > vec roots; > } *bb_vec_info; > -- > 2.17.1