From patchwork Fri Jan 12 13:47:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 124349 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2080995qgn; Fri, 12 Jan 2018 05:47:28 -0800 (PST) X-Google-Smtp-Source: ACJfBotvj7BmGN2XAtxEDJkdY8jJANBCFN97U6GU8oRJA8RKCjEXukYRkSaCKwzJrD0j9/ZxwQht X-Received: by 10.98.75.91 with SMTP id y88mr18706433pfa.178.1515764848656; Fri, 12 Jan 2018 05:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515764848; cv=none; d=google.com; s=arc-20160816; b=OpuxuH/gHkn1TY4aooc69FShVyWZJywr0Ub5PK0ee2pJZHtkIVSQv9OSYbvjbBmY6l JmCEfoqHio1M0InOEI1s5JzuiRgWkMx+DzjehV5QZpqDnXaMb726lTieDOWbF1MF0YfF b8Dob5x2rFCY8b3Ep9XNtFuztKM4zH/UbxT2dlob/z7XVbjufnrZW85TsRay91HAfEgZ JF3SgDY6eLkIop33GuphOtNqtDvQFCX1bCxyCEUgif768RdFnGTFYPNfRFihmtebpHDQ 0IAvOoLORxK2W75P1hqi+7CFImDmLZ6MyNwmdE1vlRU26fmM+zEbBRZJ1SRELdDHwgMP HBZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=3uzFeeUctRtC85JVWzmDmmBkf9JDUTN7J25xLMniYlM=; b=t5NQrtZLyojzTHXWHEw9s/ShnKtUzOV2cfSFKgHY6FODn/GaLZIQNxIhDztYCgX0G8 PNISJCqLEV94ozCtq6g4R5ioIA/lG5XrdwgAH/HwBqCDkUOm4biETU7l0B3w235PvMvM DB4+a6TnligW5EwcA/KSXFYRA5Xir/xG+XXqkH4/3CXlgHuot/ZvSy2AagsTghb8NzPM nRC+Zc9mzJfcFcsJ5w5QHBviqv8UvWoegxEAVw8NJDfMAVRv84r3zSSUQ5YrnPp89fki /Cf9Ts32fqrDA7IPl1oqqopLiXp+QBqpFgz9Tlfyls63tTkbgxEERdc2rWnzjDjzyFgv XMAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SiObYqkN; spf=pass (google.com: domain of gcc-patches-return-470983-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470983-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id t8si10078324plr.86.2018.01.12.05.47.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 05:47:28 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-470983-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SiObYqkN; spf=pass (google.com: domain of gcc-patches-return-470983-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470983-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=UR9b77eqRAdBxraQ p/gqF/jv9+lNEYLhXaysWlLRWqGXJglmEfDSq5PtT86g6kz3hYFHbMVNwSTsMBZw M6ARH/515hBwuBdSa/GXBImOde/L9RDjMkVTFQY7VdPJNPMGPbPqnCJYxOH+4xA3 igZ88YPOlROyUCtAOLBdtcn42MQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=hNkGKqJX2oVCjHC4djwiw2 kyH54=; b=SiObYqkNDfyVBiuWc37TqoFc83VW6nP5NodZyraM2Gqk7hi2E9yO08 FGbKGB7/75t2Rb+VmRVUEP8RPI3qbK7gZXZY8cZcEf+TwrpSPgXIykiqgNYqbmS1 hxkBETvmBKnIEyLJukVU9lJhzRAuVXzSlXK/2AM8O3zJ6Z4sGL450= Received: (qmail 126509 invoked by alias); 12 Jan 2018 13:47:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 126483 invoked by uid 89); 12 Jan 2018 13:47:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f171.google.com Received: from mail-wr0-f171.google.com (HELO mail-wr0-f171.google.com) (209.85.128.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jan 2018 13:47:14 +0000 Received: by mail-wr0-f171.google.com with SMTP id 16so5343758wry.12 for ; Fri, 12 Jan 2018 05:47:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version; bh=3uzFeeUctRtC85JVWzmDmmBkf9JDUTN7J25xLMniYlM=; b=XsUUtKx2S5BXT5s97xiDXGRhbHU9Y75DowZVh1hraNQT1VDsP8C7u45mNNEy3twhw9 OWQgDaIV8icCYsNmmdqzQkFNwWJP1r00gVqo74oPbEwHW2BQOrwHXkHXAYmeBKJXfCL0 D1K6BJE1PX/gy3zF23096JOP1e04QRCglWveljpqGsK3WZGv6+Duwv3v4zo6uVSb84vY /eluZtkFZM/4SRwf+lKwqHk4W+O+nE47Z1JsN30jMjUfWs3diVI3YuBMR4PvFLzLAVw3 plYlmDKLrhw495G11BfIlXYLR2MOVwR2s7ieGjwvu3ba1DFulyyshTbvbvfydiwi0Ocf IiVA== X-Gm-Message-State: AKGB3mJnLRo3fDsmppTVrRZZPLViKgNUPnyuN0mLwVWgylVZTuLdypGu vITuq88iI4D1Fz8RTM28E8s+KZD9+mo= X-Received: by 10.223.150.213 with SMTP id u79mr17605660wrb.137.1515764832205; Fri, 12 Jan 2018 05:47:12 -0800 (PST) Received: from localhost ([95.144.14.233]) by smtp.gmail.com with ESMTPSA id v191sm2724039wmf.25.2018.01.12.05.47.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Jan 2018 05:47:11 -0800 (PST) From: Richard Sandiford To: Jeff Law Mail-Followup-To: Jeff Law , gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Cc: gcc-patches@gcc.gnu.org Subject: Handle polynomial DR_INIT References: <87r2qyc1ww.fsf@linaro.org> <87y3l31se3.fsf@linaro.org> <87po6f19w2.fsf@linaro.org> Date: Fri, 12 Jan 2018 13:47:10 +0000 In-Reply-To: <87po6f19w2.fsf@linaro.org> (Richard Sandiford's message of "Fri, 12 Jan 2018 13:31:25 +0000") Message-ID: <87bmhz195t.fsf_-_@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 The idea with the main 107-patch poly_int series (latterly 109-patch) was to change the mode sizes and vector element counts to poly_int and then propagate those changes as far as they needed to go to fix build failures from incompatible types. This means that DR_INIT is now constructed as a poly_int64: poly_int64 pbytepos; if (!multiple_p (pbitpos, BITS_PER_UNIT, &pbytepos)) { if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "failed: bit offset alignment.\n"); return false; } [...] init = ssize_int (pbytepos); This patch adjusts other references to DR_INIT accordingly. Unlike the above, the adjustments weren't needed to avoid a build-time type incompatibility, but they are needed to make the producer and consumers of DR_INIT logically consistent. Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. Also tested by comparing the before-and-after assembly output for at least one target per CPU directory. OK to install? Thanks, Richard 2018-01-12 Richard Sandiford gcc/ * tree-predcom.c (aff_combination_dr_offset): Use wi::to_poly_widest rather than wi::to_widest for DR_INITs. * tree-vect-data-refs.c (vect_find_same_alignment_drs): Use wi::to_poly_offset rather than wi::to_offset for DR_INIT. (vect_analyze_data_ref_accesses): Require both DR_INITs to be INTEGER_CSTs. (vect_analyze_group_access_1): Note that here. Index: gcc/tree-predcom.c =================================================================== --- gcc/tree-predcom.c 2018-01-12 13:45:27.360582269 +0000 +++ gcc/tree-predcom.c 2018-01-12 13:45:27.533575091 +0000 @@ -680,7 +680,7 @@ aff_combination_dr_offset (struct data_r tree_to_aff_combination_expand (DR_OFFSET (dr), type, offset, &name_expansions); - aff_combination_const (&delta, type, wi::to_widest (DR_INIT (dr))); + aff_combination_const (&delta, type, wi::to_poly_widest (DR_INIT (dr))); aff_combination_add (offset, &delta); } Index: gcc/tree-vect-data-refs.c =================================================================== --- gcc/tree-vect-data-refs.c 2018-01-12 13:45:27.360582269 +0000 +++ gcc/tree-vect-data-refs.c 2018-01-12 13:45:27.533575091 +0000 @@ -2227,9 +2227,9 @@ vect_find_same_alignment_drs (struct dat return; /* Two references with distance zero have the same alignment. */ - offset_int diff = (wi::to_offset (DR_INIT (dra)) - - wi::to_offset (DR_INIT (drb))); - if (diff != 0) + poly_offset_int diff = (wi::to_poly_offset (DR_INIT (dra)) + - wi::to_poly_offset (DR_INIT (drb))); + if (maybe_ne (diff, 0)) { /* Get the wider of the two alignments. */ unsigned int align_a = (vect_calculate_target_alignment (dra) @@ -2239,7 +2239,7 @@ vect_find_same_alignment_drs (struct dat unsigned int max_align = MAX (align_a, align_b); /* Require the gap to be a multiple of the larger vector alignment. */ - if (!wi::multiple_of_p (diff, max_align, SIGNED)) + if (!multiple_p (diff, max_align)) return; } @@ -2475,6 +2475,7 @@ vect_analyze_group_access_1 (struct data gimple *prev = stmt; HOST_WIDE_INT diff, gaps = 0; + /* By construction, all group members have INTEGER_CST DR_INITs. */ while (next) { /* Skip same data-refs. In case that two or more stmts share @@ -2864,6 +2865,11 @@ vect_analyze_data_ref_accesses (vec_info TREE_TYPE (DR_REF (drb)))) break; + /* Check that the DR_INITs are compile-time constants. */ + if (TREE_CODE (DR_INIT (dra)) != INTEGER_CST + || TREE_CODE (DR_INIT (drb)) != INTEGER_CST) + break; + /* Sorting has ensured that DR_INIT (dra) <= DR_INIT (drb). */ HOST_WIDE_INT init_a = TREE_INT_CST_LOW (DR_INIT (dra)); HOST_WIDE_INT init_b = TREE_INT_CST_LOW (DR_INIT (drb));