Message ID | 87e1164d-1377-8025-223e-7c377ae1752d@rivosinc.com |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5A4E93857C43 for <patchwork@sourceware.org>; Fri, 3 Mar 2023 04:52:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by sourceware.org (Postfix) with ESMTPS id 0BEF83858D33 for <gcc-patches@gcc.gnu.org>; Fri, 3 Mar 2023 04:52:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0BEF83858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-qv1-xf2c.google.com with SMTP id o3so1073468qvr.1 for <gcc-patches@gcc.gnu.org>; Thu, 02 Mar 2023 20:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:content-language:to:subject:from :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=t+PnqXZ6Q8V0eFV64hkaiVuCLrsWOtzW/Q3GFvs/9sE=; b=zXil0fWmFlFb8yV5EqZNOFaCsj/9RSc1bmWQEowf6oQ/lGVdWnFp7fAkkOBBWotC3V F89CvcvQItw/2ScYfG54SkEj+X9bAdrpEAIDIL3J71BJ53VVjFSlEfI/yGCwjOLNWI2/ nK8SsdiMY8PX13I1CXLR15KGVjcTyz8J4b/DBaxCnY7IAT8QUp++B8dGk3KMchv5EZxO c5vjHzudL0pgao46o8mlmQHl4/zgJqxX96GhZmor82yMyWlEXFgQPdbXaDrZoQcKJFMz O5CQE16eFcVNr+mLVNiFO/A6tyCpMHRAfN/LvZa49S9SbfjQFRc8dVFiXwT9TzkX8Owe ODWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:to:subject:from :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=t+PnqXZ6Q8V0eFV64hkaiVuCLrsWOtzW/Q3GFvs/9sE=; b=2jNc9GWvfSqm3trI5FthjCGX3mcOqRAIC2+mG7KCVWt60SrH7LFLZ5qdZ7rkKIZf4b j4eANP85a6HhaprJbC4yMup2hBnbzg26WA2Ce0zX/JNT9ecbaOQHo986ygbfCgOcz8v6 crvv5GQU9yTZoEuw4k8FVPjJKW7S+Xa0725NokkvWocA8rMui5F6ZhXk0N6SR/znAOaN xX8P8HH4JxtNICjmWU7BKL72H0oOSDXAOscGkChiUSgoo8A4oBy7Fkb37T9w/dQ7GPgD sLH2DP+iIEyujy+t8UQLSga/eNiEQjVTltkwjaBGWTcna+8DO/P7GUi+0WvodD2mesEZ Osqw== X-Gm-Message-State: AO0yUKUD4i7/gPpKjd+Xbet6A1xxNn+ry0WbEjl71WchHuVc32fZsdYK BNdnQK7IpXzhQqo6QILSzBFJyL/xOftc+ufB X-Google-Smtp-Source: AK7set+0cnb9CTEMMzpP+huoNZNXOCZivWdTAifaJHCVubXb/XToy1EN+0yHCFKC6ZqqgJI6sHszRg== X-Received: by 2002:a05:6214:268c:b0:56b:f28a:ee2d with SMTP id gm12-20020a056214268c00b0056bf28aee2dmr8273836qvb.5.1677819154178; Thu, 02 Mar 2023 20:52:34 -0800 (PST) Received: from [192.168.86.117] ([136.57.172.92]) by smtp.gmail.com with ESMTPSA id 6-20020a370b06000000b0074230493ccfsm995880qkl.73.2023.03.02.20.52.33 for <gcc-patches@gcc.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Mar 2023 20:52:33 -0800 (PST) Message-ID: <87e1164d-1377-8025-223e-7c377ae1752d@rivosinc.com> Date: Thu, 2 Mar 2023 23:52:33 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 From: Michael Collison <collison@rivosinc.com> Subject: [PATCH 00/07] RISC-V: Add auto-vectorization support To: gcc-patches <gcc-patches@gcc.gnu.org> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
RISC-V: Add auto-vectorization support
|
|
Message
Michael Collison
March 3, 2023, 4:52 a.m. UTC
This series of patches adds foundational support for RISC-V autovectorization. These patches are based on the current upstream rvv vector intrinsic support and is not a new implementation. Most of the implementation consists of adding the new vector cost model, the autovectorization patterns themselves and target hooks. This implementation only provides support for integer addition and subtraction as a proof of concept. As discussed on this list, if these patches are approved they will be merged into a "auto-vectorization" branch once gcc-13 branches for release. There are two known issues related to crashes (assert failures) associated with tree vectorization; one of which I have sent a patch for and have received feedback. I will be sending a patch for the second issue tomorrow. gcc/common/config/riscv/riscv-common.cc | 2 +- gcc/config.gcc | 2 +- gcc/config/riscv/predicates.md | 13 + gcc/config/riscv/riscv-cores.def | 14 +- gcc/config/riscv/riscv-opts.h | 40 ++ gcc/config/riscv/riscv-protos.h | 15 + gcc/config/riscv/riscv-v.cc | 178 ++++- gcc/config/riscv/riscv-vector-builtins.cc | 4 +- gcc/config/riscv/riscv-vector-builtins.h | 2 + gcc/config/riscv/riscv-vector-cost.cc | 620 ++++++++++++++++++ gcc/config/riscv/riscv-vector-cost.h | 400 +++++++++++ gcc/config/riscv/riscv.cc | 321 ++++++++- gcc/config/riscv/riscv.md | 1 + gcc/config/riscv/riscv.opt | 20 + gcc/config/riscv/t-riscv | 5 + gcc/config/riscv/vector-auto.md | 172 +++++ gcc/config/riscv/vector-iterators.md | 2 + gcc/config/riscv/vector.md | 4 +- .../riscv/rvv/autovec/loop-add-rv32.c | 24 + .../gcc.target/riscv/rvv/autovec/loop-add.c | 24 + .../riscv/rvv/autovec/loop-sub-rv32.c | 24 + .../gcc.target/riscv/rvv/autovec/loop-sub.c | 24 + 22 files changed, 1893 insertions(+), 18 deletions(-) create mode 100644 gcc/config/riscv/riscv-vector-cost.cc create mode 100644 gcc/config/riscv/riscv-vector-cost.h create mode 100644 gcc/config/riscv/vector-auto.md create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/loop-add-rv32.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/loop-add.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/loop-sub-rv32.c create mode 100644 gcc/testsuite/gcc.target/riscv/rvv/autovec/loop-sub.c