From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126620 invoked by alias); 30 Oct 2019 14:21:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 126611 invoked by uid 89); 30 Oct 2019 14:21:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=sk:poly_i, type_size, TYPE_SIZE, poly_uint64 X-HELO: mail-lj1-f175.google.com Received: from mail-lj1-f175.google.com (HELO mail-lj1-f175.google.com) (209.85.208.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Oct 2019 14:21:40 +0000 Received: by mail-lj1-f175.google.com with SMTP id t5so2923329ljk.0 for ; Wed, 30 Oct 2019 07:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d87PjB19VS8z2peN0LqngAFXz5Q/NgcN68F5iTwo408=; b=HvEUe+sZMOPa8Q+G+2Vuc9nlo0zj3ZS9Nzr2sa5BvX/taCRaJOtThP4YHJILxbkrdx E/jj7bVnDTCiqxVLeRkth6BleDFlu0tUJn+ugLw82SqloK7pfoGOaT6eJLXp1ThRNtzl y6ONbpW2AGUx9x7gWtouqcFjWuVvDDRgXh487ImcDgOocKgtogRZS69Iw/56Gr2zoWA+ ZLg6q5aHXsIRVHOzFGBuOCzdKUrDT7MQ+XDiZILBPsHUKxiJyUxdJwFhlfzB0RG3h2ue 7Ve1iZ5Q2HcbPwEadQWRDsDch5iOh3RrbYcKvofgGFQi4NRxO9S1941RcK4KPcTL2k3u ndBA== MIME-Version: 1.0 References: In-Reply-To: From: Richard Biener Date: Wed, 30 Oct 2019 14:22:00 -0000 Message-ID: Subject: Re: [1/3] Avoid setting current_vector_size in get_vec_alignment_for_array_type To: Richard Sandiford Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg02133.txt.bz2 On Sun, Oct 20, 2019 at 3:23 PM Richard Sandiford wrote: > > The increase_alignment pass was using get_vectype_for_scalar_type > to get the preferred vector type for each array element type. > This has the effect of carrying over the vector size chosen by > the first successful call to all subsequent calls, whereas it seems > more natural to treat each array type independently and pick the > "best" vector type for each element type. OK. > > 2019-10-20 Richard Sandiford > > gcc/ > * tree-vectorizer.c (get_vec_alignment_for_array_type): Use > get_vectype_for_scalar_type_and_size instead of > get_vectype_for_scalar_type. > > Index: gcc/tree-vectorizer.c > =================================================================== > --- gcc/tree-vectorizer.c 2019-10-20 13:58:02.091634417 +0100 > +++ gcc/tree-vectorizer.c 2019-10-20 14:13:50.784857051 +0100 > @@ -1347,7 +1347,8 @@ get_vec_alignment_for_array_type (tree t > gcc_assert (TREE_CODE (type) == ARRAY_TYPE); > poly_uint64 array_size, vector_size; > > - tree vectype = get_vectype_for_scalar_type (strip_array_types (type)); > + tree scalar_type = strip_array_types (type); > + tree vectype = get_vectype_for_scalar_type_and_size (scalar_type, 0); > if (!vectype > || !poly_int_tree_p (TYPE_SIZE (type), &array_size) > || !poly_int_tree_p (TYPE_SIZE (vectype), &vector_size)