From patchwork Tue Dec 10 11:39:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1207040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515594-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="fajqNlj1"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47XJ5M3xDhz9sPh for ; Tue, 10 Dec 2019 22:40:05 +1100 (AEDT) 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:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=xQz+7e89JoU97c/dSddI2IuSz4QrJt6kUh4b4kvHlnjs9q2QxPYQS RiiWK65HnG4yCWP7fww6xp4osYR/7cYMfSJkTVPk1BqU7bR+BHE8xJ+KmiNgSLc6 CS9yLdRZd+ThS4rcTgVVh488tONoRK3l0Lr7qotf5U/Q68eGHpL53E= 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:subject:date:message-id:mime-version:content-type; s= default; bh=DRUngV4JlORwEdHlQiTHArvCXm4=; b=fajqNlj1XWY/+aF5ml1H m/GPa+L+HOOpiSV8A7vDy+bsuS8ioXuDY+rus6L3R6QaOKAx1/p+/8xLjh5m31hc XJJ2cyvXivqY96PikSuWVbje9lGY0URuWy87SvYjnxSktoqBk+A1xUr/9EZ+aowH XwGHd4dfJ6r+XxapFy+LG6M= Received: (qmail 7145 invoked by alias); 10 Dec 2019 11:39:58 -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 7137 invoked by uid 89); 10 Dec 2019 11:39:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2019 11:39:56 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3CC3E1FB for ; Tue, 10 Dec 2019 03:39:55 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D8D8F3F6CF for ; Tue, 10 Dec 2019 03:39:54 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Add missing conversion in vect_create_epilog_for_reduction Date: Tue, 10 Dec 2019 11:39:53 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes The direct_slp_reduc code in vect_create_epilog_for_reduction was still assuming that all types involved in a reduction are the same (up to types_compatible_p), whereas we now support differences in sign. This was causing an ICE in gcc.dg/vect/pr92324-4.c for SVE. Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard 2019-12-10 Richard Sandiford gcc/ * tree-vect-loop.c (vect_create_epilog_for_reduction): When handling direct_slp_reduc, allow the PHI arguments to have a different type from the vector elements. Index: gcc/tree-vect-loop.c =================================================================== --- gcc/tree-vect-loop.c 2019-12-10 11:30:23.506138368 +0000 +++ gcc/tree-vect-loop.c 2019-12-10 11:38:37.322774821 +0000 @@ -5054,6 +5054,8 @@ vect_create_epilog_for_reduction (stmt_v tree scalar_value = PHI_ARG_DEF_FROM_EDGE (orig_phis[i]->stmt, loop_preheader_edge (loop)); + scalar_value = gimple_convert (&seq, TREE_TYPE (vectype), + scalar_value); vector_identity = gimple_build_vector_from_val (&seq, vectype, scalar_value); }