From patchwork Mon Feb 12 23:53:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 128176 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3699516ljc; Mon, 12 Feb 2018 15:54:37 -0800 (PST) X-Google-Smtp-Source: AH8x227P/rneWnzTT7ZfSoDydDu4HVuG6lRMTvd812tDxSJs325q9WQXSG7h8BgXXNl1WZNFu5d/ X-Received: by 2002:a17:902:7848:: with SMTP id e8-v6mr12339909pln.386.1518479677109; Mon, 12 Feb 2018 15:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518479677; cv=none; d=google.com; s=arc-20160816; b=Ub44JkjPXED0HZ634Qr4IhswXoAkzNfMic3CywLoXb1G5H6h/RBG1qifju/3stdLFs wu9//NaehKBCY96yg4NSa2/879W5Btzo1WOoSqW1/v+FU6nK0P+NsnlTY8E73lWtbGoZ UZDFz/qRBUl7ehuFOOFbdFCHPGg29CID9AioEHf6fOQp0f5rKKgNDYseeNfJMDUQD9La HkU95tRxFKje0FdvKxEwvN0ZI72sXSRIaGFMohwW6jhitbDZFBdAhxNAq6iT+vYJ/gNj gSKK/TfvxRo9stN5xCPDmcXMnibLsDrzqzF6jQ0eQZpT0fUqmzA45W/WwvFnMQ5s1hmm uiqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=e39d6iILkHSHZiof23YZxg82I/RKbFozlaRDm1ajEt8=; b=vhuTWkrVJPHagYTOsOZV4NgtQ86Dinc+GqOf+Zsbs9ZwkqmUKC7Ztwh51slkxzAEte RAjAk/MOSqnWCfmcUItydWTdxmvO/tCrnyeL4ToBfPQFde5e0Xp4k5OgoB8XfvJSRLyr foOWtqc8BQEt/1GVjMXnoWnR+rd7LJlk/RKPphXiZC4ZkydxxiSwrpwhs+T4+8tZBwMw a7f7E3KmKVHii70mNNC5VQtSdScIfOteO38HZiqjNUnskRPvr9I2iF9nuix+MritWg9l BZgtc2yf0LeWBmJIfBe69d9YeGXzAHzldHg6nywlgiarljwrtPj6GQW6QQqs2Qh8gmln f4RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MYFfuEfw; spf=pass (google.com: domain of gcc-patches-return-473125-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-473125-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 e70si362572pgc.127.2018.02.12.15.54.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 15:54:37 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-473125-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=MYFfuEfw; spf=pass (google.com: domain of gcc-patches-return-473125-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-473125-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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=gvvNR33y+Mj7M8drYokAMKiaHu6PM4/FHGXITv1bvxzrZH /YnwzfwVdoW1iKiSAyJPTGY6k3c4CTYA9gSAw3HvDZXobVeH9nlb+vaoTTHBmPfp j2AJnx1bFn8RgjrSy0p3w0SXW39Wk0syFLD4k9eOL069zo6CxfBLXQh8BEUIw= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=Ew8i7t5hxFNnV9g6NvVWoqAA09o=; b=MYFfuEfw5hWtj0xUzdfw trMaR42kvMF1nCYre/0Sxq4C5WEVAC9zp2KD2gae3ddEXLginjtiVPXvJnn5uUy/ fhm/lCY7y39Cv4lhQ15lF9uyNPqY2gwUWDnconsvHK1ghKgYhh1IGB5u38hLZIoz C3Bj30gtLeqFCRoK9hbmvfk= Received: (qmail 14975 invoked by alias); 12 Feb 2018 23:54:26 -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 14965 invoked by uid 89); 12 Feb 2018 23:54:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f169.google.com Received: from mail-qk0-f169.google.com (HELO mail-qk0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Feb 2018 23:54:24 +0000 Received: by mail-qk0-f169.google.com with SMTP id o7so6121528qkc.1 for ; Mon, 12 Feb 2018 15:54:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=EOi1WHHLvxmzqgIoUixCbfsUS77XSxQ3BjZY4e0L9CU=; b=TgnCj+iz59DERgXGkGQJnC+a5IV7nJdRQq4Fx1eeu5F09m/suc7BgFong6/igK7bP4 e4r20XjXMzW1LMyqsQrMJOtSmILKjZMxQSROBLD7n7zq44cS2qXqngQTrnmRGHDhLOzw rmSqK8WHLdbU3c5W3zkzR+rcJM3vJ6qjt1XDqLUbJisKKgPpQSjAybyZ23QJ5I2v7yYQ GaDz/tv02mfWSt3LvU2HXaC/pAJgjQ2Eo80+pcBfRqveo4lXDrFCwTzfdx4YCncfLe9G 8fEIYii7lbymTiiR93hLVmTv0ImHlGP6IV9XCuyEzV+tSCAhm4k6PWzZ/gmCq6WmK011 t61A== X-Gm-Message-State: APf1xPCdqU6MLZU4/ZzBUH4DWnrLlWHn2j8wSbvPrq9LYe1ChpB7KlDr U9FUsLZhrGsEfiwqUdldH04Juf464AX3rGyjS2X6MfY2 X-Received: by 10.55.72.131 with SMTP id v125mr20519835qka.323.1518479662356; Mon, 12 Feb 2018 15:54:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.36.185 with HTTP; Mon, 12 Feb 2018 15:53:41 -0800 (PST) From: Kugan Vivekanandarajah Date: Tue, 13 Feb 2018 10:53:41 +1100 Message-ID: Subject: [RFC] Adds a target hook To: GCC Patches X-IsSubscribed: yes Adds a target hook TARGET_HW_MAX_MEM_READ_STREAMS. Loop unroller, if defined, will try to limit the unrolling factor based on this. gcc/ChangeLog: 2018-02-12 Kugan Vivekanandarajah * doc/tm.texi.in (TARGET_HW_MAX_MEM_READ_STREAMS): Dcoument. * doc/tm.texi: Regenerate. * target.def (hw_max_mem_read_streams): New target hook. >From 95287a11980ff64ee473406d832d75f96204c6e9 Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah Date: Mon, 12 Feb 2018 10:42:29 +1100 Subject: [PATCH 1/4] add-target-hook Change-Id: I1789769c27786babc6a071d12049c72d7afed00e --- gcc/doc/tm.texi | 6 ++++++ gcc/doc/tm.texi.in | 2 ++ gcc/target.def | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 7f02b0d..08f4e2a 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -11718,6 +11718,12 @@ is required only when the target has special constraints like maximum number of memory accesses. @end deftypefn +@deftypefn {Target Hook} signed TARGET_HW_MAX_MEM_READ_STREAMS (void) +This target hook returns the maximum number of memory read streams + that hw prefers. Tree loop unroller will use this while deciding + unroll factor. +@end deftypefn + @defmac POWI_MAX_MULTS If defined, this macro is interpreted as a signed integer C expression that specifies the maximum number of floating point multiplications diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 90c24be..e222372 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -7927,6 +7927,8 @@ build_type_attribute_variant (@var{mdecl}, @hook TARGET_LOOP_UNROLL_ADJUST +@hook TARGET_HW_MAX_MEM_READ_STREAMS + @defmac POWI_MAX_MULTS If defined, this macro is interpreted as a signed integer C expression that specifies the maximum number of floating point multiplications diff --git a/gcc/target.def b/gcc/target.def index aeb41df..29295ae 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -2751,6 +2751,15 @@ number of memory accesses.", unsigned, (unsigned nunroll, struct loop *loop), NULL) +/* Return a new value for loop unroll size. */ +DEFHOOK +(hw_max_mem_read_streams, + "This target hook returns the maximum number of memory read streams\n\ + that hw prefers. Tree loop unroller will use this while deciding\n\ + unroll factor.", + signed, (void), + NULL) + /* True if X is a legitimate MODE-mode immediate operand. */ DEFHOOK (legitimate_constant_p, -- 2.7.4