From patchwork Mon Apr 4 16:43:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Coplan X-Patchwork-Id: 1613121 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=re4WJeB1; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KXGqB2TFRz9sBJ for ; Tue, 5 Apr 2022 02:45:24 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 769B83857C41 for ; Mon, 4 Apr 2022 16:45:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 769B83857C41 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1649090721; bh=cnO3N9PzU2vT3gyExoYm9hWzC3GylcRmsSi6sgyvyLs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=re4WJeB1oE1aqwIgozaL2WfUrI6mHp7pnxXm5WCyUrFwm3k25Iz9wAL4EFi7ZuPB9 B0nNmoWrD0hW3/r2fU8xeR7j5FJMNpIYbez90bUoh+DYzagZcoYYPasBjJaAzmLjTT MUlJStIGa/W5ysc2WrEiC6F6lMTOduj6epCgDqa0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2049.outbound.protection.outlook.com [40.107.20.49]) by sourceware.org (Postfix) with ESMTPS id AB061385842B for ; Mon, 4 Apr 2022 16:44:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AB061385842B Received: from AS9PR04CA0071.eurprd04.prod.outlook.com (2603:10a6:20b:48b::20) by DB8PR08MB4572.eurprd08.prod.outlook.com (2603:10a6:10:b0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31; Mon, 4 Apr 2022 16:44:07 +0000 Received: from AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:48b:cafe::69) by AS9PR04CA0071.outlook.office365.com (2603:10a6:20b:48b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31 via Frontend Transport; Mon, 4 Apr 2022 16:44:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT050.mail.protection.outlook.com (10.152.17.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.19 via Frontend Transport; Mon, 4 Apr 2022 16:44:06 +0000 Received: ("Tessian outbound facaf1373bbd:v118"); Mon, 04 Apr 2022 16:44:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c26276bfec667ca4 X-CR-MTA-TID: 64aa7808 Received: from a3ccedc672c1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 0CBEDF42-0319-4D67-BA9B-3498F93AF28D.1; Mon, 04 Apr 2022 16:44:00 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a3ccedc672c1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 04 Apr 2022 16:44:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LC2lH7IoVxM+JY1XKI3RyZXLc3Y2U92EcQwZQ5GKyEKhWga5wv78qBPlrvdQMLQm5IoiOlO0lfnSxB3ortp6BiLwMsAmg1rgfhftLDOH2Ntu/hDnL4t+WvvdFvL3ml0FA/CYTN/30RQITKaE6lMPAAV1yrIDnLtTih8AXgn8PvE+RkPpqZI+lKCmWg20wTzk4kEBsIhQ994WeRdKvp5Z5jguKQYLgiEXglqrS4bw8d/MtWYsvfrf8RR1eS4KXPAHpYT5XYEWruKup2rcgAmRnFRyKkEOqPbw5MNCIIBY5dxKeO9Aat3qCYDwfEXGPKrO52+cn6+FJz365XUL2AkAng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cnO3N9PzU2vT3gyExoYm9hWzC3GylcRmsSi6sgyvyLs=; b=Eey3WktV1TsVli87t76nydk0WyrIKF1FRqKdRUsHcRPD35Oy2duImYJucCTQ+kUPylKyZgJFT8STRASJon6FOz8woBQteMM1WdG8DNchS+hlCbw5HOFeiDSnnVBtEHIkYT2/m8urU856G6yf76/Segbiz/y2wx8Bhm3jQJG9qAgcyjnBVIXcY942L/ZKuHK6esNHM7bholUfG+FlQFxkTRTrU94tzOclFvxSuyORB5N/Tjh1+L67UZ+zDeJgr6X22ipQb+8mp0X78nG5yVgiiXQSDWKsh6e9GrPTWQziorsGg/0dGa9HSX6Jn72gdRRJe8Xj41nx0ta8Cf4AJJEGoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PAXPR08MB7201.eurprd08.prod.outlook.com (2603:10a6:102:208::18) by AM0PR08MB3409.eurprd08.prod.outlook.com (2603:10a6:208:d4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.31; Mon, 4 Apr 2022 16:43:55 +0000 Received: from PAXPR08MB7201.eurprd08.prod.outlook.com ([fe80::8467:33e9:2c4b:c7b7]) by PAXPR08MB7201.eurprd08.prod.outlook.com ([fe80::8467:33e9:2c4b:c7b7%7]) with mapi id 15.20.5038.015; Mon, 4 Apr 2022 16:43:54 +0000 Date: Mon, 4 Apr 2022 17:43:32 +0100 To: gcc-patches@gcc.gnu.org Subject: [PATCH][committed] doc: Fix typos in match.pd documentation Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P265CA0020.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::16) To PAXPR08MB7201.eurprd08.prod.outlook.com (2603:10a6:102:208::18) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 718ae49d-b111-439b-4699-08da165a55c7 X-MS-TrafficTypeDiagnostic: AM0PR08MB3409:EE_|AM5EUR03FT050:EE_|DB8PR08MB4572:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Dhz6cpkwpM+SXf+kSU3FBi51jRJCV/3BHUOA8u4CMWQ4tT1XZ3T4Q0VvEZPpAK+Y3s383MTaeI2VtMJ9TURYrwEpRhD7uzOa2SCnIYDcG558O9G0M6YvIliT3lvI/TBFUTHOVXtN9HMFKBPTzUQmF9LHw20O7U9lYe81mgq4cq141kBXawkqOZYUZF3Eu4H2jsqUnN06lho1c7XKnuftUk09KZ1vDB4uHvk7oV1AlOV1Con/vYtjP2qBxW1AKBHjPkZuhJiqm8wIark2+Ohm3aIzLz4LM2/NZPAbnXviu45xi1u8U1xLb2ydVyLilS2C3BuLTuyDHt2kTkMy5wSjHhySmCDjcrbEE/McMz2N82mfpCf3dJ73MopQtRXtvGv/GTOmwCwcVwdTeSoKG4BSNy0d54PhAcORts3OZzEpFJd0qGlXt7BJrI6+35TuURlBvsu19c/htNFz+GGuozP2Ice0S2zE7N5Ha5W8vA0oLcukGQnkPebI4/j2CP8/WwVXpwqMbaNSQvKfrYnbLkhiDTxARv1GEeG9Who68DiXrbh8xGHhL2cppILfLIe9VulFpCJ5ftOoW5CfSNfYJpX4Q0sOndDwkkCNNRlaqNzJmlzjto85CrtSoISiJt7VLiVcgsqHrQ45cCGGcyj0Gmna9Qm2ia5Aa/ZsiKGsfNrDnwHo+bDMWoAyPjH/fyzg5UrDduxfT4wGoLiAjakwBFNquQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR08MB7201.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(8676002)(66476007)(66556008)(6486002)(316002)(6916009)(186003)(26005)(6666004)(6512007)(6506007)(33964004)(21480400003)(2906002)(66946007)(2616005)(508600001)(36756003)(8936002)(38100700002)(564344004)(44832011)(235185007)(5660300002)(44144004)(86362001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3409 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7a86a0c7-8454-4996-aed6-08da165a4df8 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TG5vyq0t/oxSCEY6Y+Pk6W5W+LAcJX8Ckz/DVrEBOeNc97WAqSR3DdOy1SuzVBZM1t/HAWb3ZiXD4GjGiFM+D7EIBMX+KWA9t2QocZl3qRBC5Tpqp1b9hm4vfvdoQPLqp3hfYwwk8ijb1KL2P/CsaWHjZp18HNP/mw8x8GXwkscOJv3RSacOFEXSShSEqm7cVU2W38P/oI/x1FsaZm4naL4zrtHql5QmVPVmbgnNFpeBF4eix7FwYsoqf4sDUpR1zn9/RLMF2pxxJ88NnBvvkl0kXHW61ocVe2umWt7rmTN95r0qPaC55o0A82s9qsjRpIIWypS1jvuIerMjviJChiellyp8e7+4QaVcX359prNkqyt2BSA6Z9LlChuwRw0lcMg6G+6Z9hsmC/VWBMd0NEa8SOHC/E/Nvzhv6RalYwTMNlYaoQ7CT3lWIZ+4tFRfL15/7O5eB7BWAUy5vZqxoqygw6lUPpEJdRgBFAJ8UNVFOFOOIByFsTTWCu0bGqHXi/ZKB68bY+nSfaCzbwoY61gJUrdrotfERAryqsUILVMp9mols9fUoOqaiKa4/tQcX5AwIardFbaem+t8hoFSXVyylHLgTTW1qfaStfOervUNgVhBF475IeKhMR3p2VQKuNb+eS59+zajAPxR9gDf0R9sP3Xe8HK++hs+PznZHxnreJSaeTBGvgIxWoWx5pZkkNe53b1quBYO69T//DvR/Q== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(6512007)(40460700003)(44832011)(186003)(86362001)(82310400004)(33964004)(6506007)(356005)(44144004)(21480400003)(508600001)(564344004)(235185007)(26005)(6486002)(2906002)(316002)(8676002)(6916009)(336012)(36860700001)(2616005)(6666004)(70206006)(70586007)(81166007)(8936002)(47076005)(5660300002)(36756003)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2022 16:44:06.7399 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 718ae49d-b111-439b-4699-08da165a55c7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4572 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alex Coplan via Gcc-patches From: Alex Coplan Reply-To: Alex Coplan Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch fixes some spelling and grammar issues in the match.pd documentation. Pushed as obvious. Thanks, Alex gcc/ChangeLog: * doc/match-and-simplify.texi: Fix typos. diff --git a/gcc/doc/match-and-simplify.texi b/gcc/doc/match-and-simplify.texi index 055a5308e7d..b33d83518a7 100644 --- a/gcc/doc/match-and-simplify.texi +++ b/gcc/doc/match-and-simplify.texi @@ -19,7 +19,7 @@ tries to address several issues. gimplifying via force_gimple_operand @end enumerate -To address these the project introduces a simple domain specific language +To address these the project introduces a simple domain-specific language to write expression simplifications from which code targeting GIMPLE and GENERIC is auto-generated. The GENERIC variant follows the fold_buildN API while for the GIMPLE variant and to address 2) new @@ -40,7 +40,7 @@ APIs are introduced. @deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, gimple_seq *, tree (*)(tree)) @deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, tree, gimple_seq *, tree (*)(tree)) @deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, tree, tree, gimple_seq *, tree (*)(tree)) -The main GIMPLE API entry to the expression simplifications mimicing +The main GIMPLE API entry to the expression simplifications mimicking that of the GENERIC fold_@{unary,binary,ternary@} functions. @end deftypefn @@ -57,7 +57,7 @@ a valueization hook: @end deftypefn -Ontop of these a @code{fold_buildN}-like API for GIMPLE is introduced: +On top of these a @code{fold_buildN}-like API for GIMPLE is introduced: @deftypefn {GIMPLE function} tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree (*valueize) (tree) = NULL); @deftypefnx {GIMPLE function} tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree, tree (*valueize) (tree) = NULL); @@ -78,9 +78,9 @@ and simplification is performed using the optional valueization hook. @section The Language @cindex The Language -The language to write expression simplifications in resembles other -domain-specific languages GCC uses. Thus it is lispy. Lets start -with an example from the match.pd file: +The language in which to write expression simplifications resembles +other domain-specific languages GCC uses. Thus it is lispy. Let's +start with an example from the match.pd file: @smallexample (simplify @@ -100,7 +100,7 @@ function code names in all-caps, like @code{BUILT_IN_SQRT}. @code{@@n} denotes a so-called capture. It captures the operand and lets you refer to it in other places of the match-and-simplify. In the -above example it is refered to in the replacement expression. Captures +above example it is referred to in the replacement expression. Captures are @code{@@} followed by a number or an identifier. @smallexample @@ -110,10 +110,10 @@ are @code{@@} followed by a number or an identifier. @end smallexample In this example @code{@@0} is mentioned twice which constrains the matched -expression to have two equal operands. Usually matches are constraint -to equal types. If operands may be constants and conversions are involved +expression to have two equal operands. Usually matches are constrained +to equal types. If operands may be constants and conversions are involved, matching by value might be preferred in which case use @code{@@@@0} to -denote a by value match and the specific operand you want to refer to +denote a by-value match and the specific operand you want to refer to in the result part. This example also introduces operands written in C code. These can be used in the expression replacements and are supposed to evaluate to a tree node which has to @@ -129,7 +129,7 @@ be a valid GIMPLE operand (so you cannot generate expressions in C code). Here @code{@@0} captures the first operand of the trunc_mod expression which is also predicated with @code{integer_zerop}. Expression operands may be either expressions, predicates or captures. Captures -can be unconstrained or capture expresions or predicates. +can be unconstrained or capture expressions or predicates. This example introduces an optional operand of simplify, the if-expression. This condition is evaluated after the @@ -219,9 +219,9 @@ Captures can also be used for capturing results of sub-expressions. @end smallexample In the above example, @code{@@2} captures the result of the expression -@code{(addr @@0)}. For outermost expression only its type can be captured, -and the keyword @code{type} is reserved for this purpose. The above -example also gives a way to conditionalize patterns to only apply +@code{(addr @@0)}. For the outermost expression only its type can be +captured, and the keyword @code{type} is reserved for this purpose. The +above example also gives a way to conditionalize patterns to only apply to @code{GIMPLE} or @code{GENERIC} by means of using the pre-defined preprocessor macros @code{GIMPLE} and @code{GENERIC} and using preprocessor directives. @@ -314,9 +314,9 @@ and use them in @code{for} operator lists where they get expanded. So this example iterates over @code{plus}, @code{minus}, @code{mult} and @code{trunc_div}. -Using operator lists can also remove the need to explicitely write +Using operator lists can also remove the need to explicitly write a @code{for}. All operator list uses that appear in a @code{simplify} -or @code{match} pattern in operator positions will implicitely +or @code{match} pattern in operator positions will implicitly be added to a new @code{for}. For example @smallexample @@ -359,7 +359,7 @@ type of a generated expression with the @code{:type} syntax where @code{type} needs to be an identifier that refers to the desired type. Usually the types of the generated result expressions are determined from the context, but sometimes like in the above case -it is required that you specify them explicitely. +it is required that you specify them explicitly. Another modifier for generated expressions is @code{!} which tells the machinery to only consider the simplification in case @@ -402,7 +402,7 @@ The support for @code{?} marking extends to all unary operations including predicates you declare yourself with @code{match}. Predicates available from the GCC middle-end need to be made -available explicitely via @code{define_predicates}: +available explicitly via @code{define_predicates}: @smallexample (define_predicates