From patchwork Fri Nov 10 10:15:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 163793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1011578vqs; Fri, 10 Nov 2023 02:16:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IE364fXQWB5AqB9AMpKCcItOGFPisW6AmB3O5kqx0quXQnG8ZmeBvKY4nCf072xBYqN3tJP X-Received: by 2002:a05:6122:31a4:b0:4ac:6a9d:c49b with SMTP id ch36-20020a05612231a400b004ac6a9dc49bmr3895873vkb.14.1699611375685; Fri, 10 Nov 2023 02:16:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699611375; cv=pass; d=google.com; s=arc-20160816; b=p9PXM846+w/K2FAPvo2rUtMwUrlM4FiArsxtk9iQoPgg5tBhxcne5gGWTPvWxmOACS dyQKX0fPyCMcg+m/fJczA/uekEkKC1bIe3HWN+VLLn+wUA5pW4X0rgRWGj1+DabupE+h NvzKO3uYBdhGBY266t16jalqqq2AbmoY1m665aRWiBbkRc2bNZIuUly9QIR6nxWK4jbT Uik7zA5BMwVqKb/ZQY65r5oQWiA9OgfXfY+V7mkExaeYyG7odN3gbNYM039UHZLZZJiO 9NIf+qxpy+DydsyggLM33e5N2jpxKFIn0F7VDtiZ7CbJvCHjyXX0BqiqJRV0qPafN4Aa i5zA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:from:to :content-language:user-agent:mime-version:date:message-id :ironport-sdr:arc-filter:dmarc-filter:delivered-to; bh=4NTCfvY0bNntxvsciTg90HIzv5++7KRqyLz611XK4+s=; fh=XNn3asQvIblazGK92GBt13dVv+YmGV3pBS0JC29ZQco=; b=QEN1ElKmWmwQuKEkOKZszceIOiMpcNxmjbl4EwEMe9RfLR1Trn9MM7UlFe+AF10tyT iT75l7jnmdIdt9MAgl8u6aVkiZtgggtusdU3gbFeixaNf0gTyDGE2vXDPuFb/u08F6Fc 9KsxzyfoooveVlmxajE+xdjJ4hmWx7cKneiia9jdvJMzwSVDFvw3Wy6wNFExrxLiVclj PYHyc1nN3MX2GZJuB6AXT071hAcgsV/PbBG/Rt1IYFmd3SmIKXOc7uXwegvRldfwjfoy NqRN8BKDcNy+IXuDjkXAqS+b/wT8JCx5f91IP6n3J6joFOrzArw+7SJ4qj0m/E2BmAcX uDPg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w21-20020ac87e95000000b004181b434f3esi4342205qtj.147.2023.11.10.02.16.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 02:16:15 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 73C62385696F for ; Fri, 10 Nov 2023 10:16:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id A4E0D385DC1C for ; Fri, 10 Nov 2023 10:15:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A4E0D385DC1C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A4E0D385DC1C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.129.153 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699611351; cv=none; b=l8Z0nLrjGr/2o7AExB75QiiZhPIrWe4OyvWCEz00UxgnKTH/Z8Gu1PvuC6yzgpMgOuGXxATDo/k1efHYW07tQYPzojh9p/qcnENr5FLe3U5gybvSVcWC12zY4U/y394YZ8rkwAnlchmt0fTnjzLKF+ae+9MTiVGmVNotPtdMMbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699611351; c=relaxed/simple; bh=vq6P5+B8ef8cBd+TaD3diY2gkYPNJQTG8oN4PEe0X/g=; h=Message-ID:Date:MIME-Version:To:From:Subject; b=xbIQfUXUCFCNRPNB3uwDwo7O+12wBSwSu50PVruQ6WqmtJPrqMHrH1p0FTgObJ9pKQEtem3kBkPDkugbEcIA9VkzhDDQdNPYf0atNcRonIkKbkHOeP7CJQtVNtnxo5kCLPBrmffsvOwUL0pyyhU1vTATD53h2SyzEp4ZcWmdekM= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: oKQ6w0DqSCysX5JU5uhvxA== X-CSE-MsgGUID: TYQDgh4nSYianNWvqXdFJw== X-IronPort-AV: E=Sophos;i="6.03,291,1694764800"; d="scan'208";a="25371888" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 10 Nov 2023 02:15:47 -0800 IronPort-SDR: uInLrGHrnF8u2bhXbPv1JDaf0GgGcuQxYwNhDzzbBVVOyBPx2VPA4b7Lt2msCpSmRXQhF+N3EO b4wLOLMjvi0rpVwKA4HvBaupn6m0JwasXdfl+k4lrDxdr3vmWUbaLZYhoonxwTVFxjJ7IiPNp2 tXhujL9YsVy1Rm6B16Gdw2+pHg24vF7BCtIk1Nno6ZVAtf2sz93QmIQ8xMOXu2y5uR1ZUChMJ9 TQS/B3QC7i/H3Dk2MC4y8+/tLTkJ/uJX+lvcTak+7oeFpLGn8JjkjDk+hSTqyzrprLCswIxP8T YGk= Message-ID: <49e97674-bb26-447f-b0c2-a771a7e8feec@codesourcery.com> Date: Fri, 10 Nov 2023 10:15:42 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-GB To: "gcc-patches@gcc.gnu.org" From: Andrew Stubbs Subject: [committed] amdgcn: Fix vector min/max ICE (pr112313) X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782171698317849867 X-GMAIL-MSGID: 1782171698317849867 I've just committed this patch to fix pr112313 (oops, I forgot to write the number in the commit message). The problem was a missed case in the vector reduction expand code. Andrew amdgcn: Fix vector min/max ICE The DImode min/max instructions need a clobber that SImode does not, so add the special case to the reduction expand code. gcc/ChangeLog: * config/gcn/gcn.cc (gcn_expand_reduc_scalar): Add clobber to DImode min/max instructions. diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc index 6a2aaefceca..ac299259213 100644 --- a/gcc/config/gcn/gcn.cc +++ b/gcc/config/gcn/gcn.cc @@ -5514,7 +5514,15 @@ gcn_expand_reduc_scalar (machine_mode mode, rtx src, int unspec) { rtx tmp = gen_reg_rtx (mode); emit_insn (gen_dpp_move (mode, tmp, in, shift_val)); - emit_insn (gen_rtx_SET (out, gen_rtx_fmt_ee (code, mode, tmp, in))); + rtx insn = gen_rtx_SET (out, gen_rtx_fmt_ee (code, mode, tmp, in)); + if (scalar_mode == DImode) + { + rtx clobber = gen_rtx_CLOBBER (VOIDmode, + gen_rtx_REG (DImode, VCC_REG)); + insn = gen_rtx_PARALLEL (VOIDmode, + gen_rtvec (2, insn, clobber)); + } + emit_insn (insn); } else {