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: 872528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-473125-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Gyy0s1M8"; 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 3zgMw91f4gz9sBZ for ; Tue, 13 Feb 2018 10:54:32 +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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=p00CJVt6MKwve4+2CPC6g+e9SZ7ckb9WQimzFLmCLnMpkB aIO62IuQ7hkCZXKYLnsMhzIb5oAHTHmgI4ledTu+epSX3C6fa8tfSCOUDeDLWBTk G8kq/yi2b9jMIDsUyUDJU2YKZOOFUpVbcM/BfazJRUOrFoRB0Dg5Eh5tA/Jus= 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=Gyy0s1M89plA8rhkQ4lU J95f/akK1Pu83iY+mxd0XB7NykdEPLdfR49bLowGQTIe2WctLi3xiddxqs+TET+o 6/aRa8vtpAFVD3XkO+xp39P8VBKQHz12LL9TwwtUeA9YhSxl15eawX5sHetjpZ6k yFG4/grKaanrzw7b5Q6vRLA= 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-Google-Smtp-Source: AH8x224oV6MpEVn+y/bojaL6VFrsCnEbDS6zPgfE8+9CDSF/udpggqu6S8exR9jl8pJH/OPFJFq9ZXwBIXUc8eJdSvU= 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