From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2052.outbound.protection.outlook.com [40.107.22.52]) by sourceware.org (Postfix) with ESMTPS id 16C5838930DF for ; Fri, 24 Jul 2020 13:21:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 16C5838930DF Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Andrea.Corallo@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NTdTcrA0JplyktJ5gBW5dsp+kCKhHAd8VARimdodxIM=; b=s4zTgwEN95GCncReOIXwQ7SKKAEezmZ7rQYAZK839vT8MDJV0SgAa8oygPBctKAEhfiTBt9ZubU9wIkALtVEffPvTCKST4cxJdCp6x52GSo1H3kUW5x3Km3JujlsaCwCrJuAAEtUMbyl2SOcKx35t6JQS0yxJcAaxRRaEJj7LjI= Received: from AM6P194CA0087.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::28) by VE1PR08MB5248.eurprd08.prod.outlook.com (2603:10a6:803:10c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23; Fri, 24 Jul 2020 13:21:41 +0000 Received: from AM5EUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8f:cafe::36) by AM6P194CA0087.outlook.office365.com (2603:10a6:209:8f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.23 via Frontend Transport; Fri, 24 Jul 2020 13:21:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; dmarc=bestguesspass 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 AM5EUR03FT021.mail.protection.outlook.com (10.152.16.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.10 via Frontend Transport; Fri, 24 Jul 2020 13:21:41 +0000 Received: ("Tessian outbound 7de93d801f24:v62"); Fri, 24 Jul 2020 13:21:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8ef2bf922dbcd8c6 X-CR-MTA-TID: 64aa7808 Received: from dd1c2afb36da.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B54AA45C-C821-4347-885F-D4DD12F179DF.1; Fri, 24 Jul 2020 13:21:35 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id dd1c2afb36da.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 24 Jul 2020 13:21:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jqE4Xd5qTA97y7hDVOWaWhEp2C8uzvNZk0MvagAguYrjr62M+odq55XBxqdqwnubcnt85BdwazDDTF//A8C6uxK1OfM0fETBAGrbzU5ujhJc+/ewm4+OecbHQMKkAZPcOaNDpDlZngD8C3hSDUdhW8APQFlpRdWFCBMKbt+tGKvQwEaQcF5w+KXvI27lZMU1TYOTeGNt5v2YDnOVLWUcS+DKMOXpls4oqrchRO/oozv7VLZ76Y71iAgM4LvJw1qwJT2sKNjgpReRGdHZ0A/dkdGm2UnbfehrLvz4v8PXZxoyTskCdq/Rr7DUepYHIXltXTODQQrzqsTlzKiQW7FsjQ== 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-SenderADCheck; bh=NTdTcrA0JplyktJ5gBW5dsp+kCKhHAd8VARimdodxIM=; b=nnqfNXzSyJGKozsuhq2Vq9etqQXdRApdwXK1sd088kRUXBiOIO6Ne9PqHcfUAM5R74NvnPgmtdUTV+vW6IuV4YuY0AxAsVw1o5R9vyzRn2dvtMwedHsjApLqnJ14iBlhrD57nag8O/pWVQOwdYiJXk0yLD6dWw5+eArKgfNPKqNI87A5XkqzX9LaJzZloju+CrSkU3yUIi9psnvAEKqRvPUzlhqiFZ/zlfHfkz7I1tZ68bTKcKHGOO+jmzsyUvV7LVmX+ilF0XxfAKoF7LWHW0WXqLaK4b3HFSA80We0YR2HIsn20vW2rYn7yvtSL3Lz03jR/hsATNqxSBed70D2DA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NTdTcrA0JplyktJ5gBW5dsp+kCKhHAd8VARimdodxIM=; b=s4zTgwEN95GCncReOIXwQ7SKKAEezmZ7rQYAZK839vT8MDJV0SgAa8oygPBctKAEhfiTBt9ZubU9wIkALtVEffPvTCKST4cxJdCp6x52GSo1H3kUW5x3Km3JujlsaCwCrJuAAEtUMbyl2SOcKx35t6JQS0yxJcAaxRRaEJj7LjI= Authentication-Results-Original: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received: from DB7PR08MB3594.eurprd08.prod.outlook.com (2603:10a6:10:4e::11) by DB6PR0801MB1800.eurprd08.prod.outlook.com (2603:10a6:4:38::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.24; Fri, 24 Jul 2020 13:21:33 +0000 Received: from DB7PR08MB3594.eurprd08.prod.outlook.com ([fe80::9f3:461:834d:7ca]) by DB7PR08MB3594.eurprd08.prod.outlook.com ([fe80::9f3:461:834d:7ca%7]) with mapi id 15.20.3195.028; Fri, 24 Jul 2020 13:21:33 +0000 From: Andrea Corallo To: Segher Boessenkool Cc: Andrew Pinski , Richard Earnshaw , nd , GCC Patches Subject: Re: [PATCH 2/2] Aarch64: Add branch diluter pass References: <20200722164322.GA32057@gate.crashing.org> <20200723224715.GK32057@gate.crashing.org> <20200724115347.GM32057@gate.crashing.org> Date: Fri, 24 Jul 2020 15:21:21 +0200 In-Reply-To: <20200724115347.GM32057@gate.crashing.org> (Segher Boessenkool's message of "Fri, 24 Jul 2020 06:53:47 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-ClientProxiedBy: SN4PR0601CA0009.namprd06.prod.outlook.com (2603:10b6:803:2f::19) To DB7PR08MB3594.eurprd08.prod.outlook.com (2603:10a6:10:4e::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from e112547 (217.140.99.251) by SN4PR0601CA0009.namprd06.prod.outlook.com (2603:10b6:803:2f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3216.21 via Frontend Transport; Fri, 24 Jul 2020 13:21:31 +0000 X-Originating-IP: [217.140.99.251] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fbd53355-6187-48c7-0ccc-08d82fd480af X-MS-TrafficTypeDiagnostic: DB6PR0801MB1800:|VE1PR08MB5248: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: rqKA5xTvYCA6WEQMKnLmgHR5x+8WtcermqSFfQQnRyyVvH2hNZYLZvWklYd+1eQEwkhau0YIgBsYstkjkkOqBXF4hLhft7kFFPl0+FtZSqnOj+K/zUHpgtjcG/EYZl62rG+7Z+Z2GJvXdUPYOPdfqezc2T4NtXAWkCl9e7+Ulw1Yk6M/dQENrip3pMYd2z22s61S7/d18YbJjedsc43269EdySdcmh03x9a4pB3lAjhBVgM2ztJYlvhCFWbfK0t9L66lhBhQMrh1gz2ogpHEeTi6cms7Fwr8fvq4awQeybMT0mkAp9SrmccYBmUtxmONtHpdhpetz5J7lt0h+muWJm/rCRkT8ZWvhrFciBBUtXUU8r6dOOW4GJGpMLFzeWxN X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR08MB3594.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(346002)(376002)(366004)(39860400002)(136003)(16526019)(186003)(66476007)(8936002)(44832011)(2906002)(83380400001)(6916009)(66556008)(478600001)(5660300002)(6496006)(52116002)(36756003)(2616005)(26005)(8676002)(6666004)(956004)(86362001)(4326008)(66946007)(54906003)(316002)(6486002)(4226003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wrlrjF16zgFXnEPa7wq8BZ+fp/syiD+Ck4qtUP3JrEg1bWZfzY5IYhH3cuNIqC6s3LYKtsWjpRPvdFdsLuPrgF4avRkfgI22lKg+XalDtsvozRBTSP4Cm4tmwIDnzu5QotEtpVlFK/k9r57jD5cvbyBAekLRTh3pdZInLxSTBW05cho+yR/GnM+nFzPXg5MnOtpOjTWEwvbbQMIOc4PXn9wZGM5++BgRLK7EFy0gQA32IJQoXINC2bNX8wfnbhw/7AkBWip+RIVTwRoBJOazAQ7uxZMUW2rhyEJKK57AICoipaauIRgEvbJsFYj7kxLHzHeSr3GFIpcegDM8zi5VfsY01IqwAtinpqV+ok8V6NhN5UurM2HgTRhVo3LiiS3ydlIORVDxno4o7yd5ZJZBUjfn7Ifs913J7NuVFCwUTKuHtGyG/oT7PDp2EZkgCvsUqLxgTys+UbjCmtBohiOcAJrW9+1xyZO2WcDGmMA6kqSLQ0jIXbGFT4gQM3fs1fgz X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1800 Original-Authentication-Results: gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: f9a68e33-a96e-469a-f17d-08d82fd47bda X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CEFkUznHhN+N7Ia7Kwj3FOV5y1CCMpNDqTZllw16yH6vZ3SK8YcUAPSnYRW/lldUUaWsbkDGQWSn3XTHE0vBav2BYPXiAuAQYGVKegPbEhJ1b5fg6z8exSTg/GJv3l9vPstYIS1mlFCj8TMPFix0Vrfvp5PUDLuL3vNo2aeQ9almJjcNFXCB7vTvDyiT1ra9jtaYYMQmdXPALZNRnbRZJVHSts/1Mzj82hfUllH+wv9XqQXm1W8ZyFxR4oqXzGDDny1qGUvQ4jUR8RVqN4vnXnLlX7+4cfpddyx/ordYd8SkNepyNhj3W5Gb5Bzjd3ebI1pWRUDvCZqR9c6ZpfvtFLL861eLWP24EAInG4L1DDP7Y8+jrhW2Z3m1amn3swzGXr/z6BVdiHGWHAiF0AUguZYx4A+IUJOBAz3CT3evUn8= 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; SFTY:; SFS:(4636009)(39860400002)(346002)(376002)(396003)(136003)(46966005)(4326008)(336012)(8936002)(70206006)(6862004)(36756003)(5660300002)(36906005)(6666004)(316002)(54906003)(8676002)(70586007)(2906002)(86362001)(186003)(81166007)(6496006)(956004)(6486002)(44832011)(16526019)(26005)(47076004)(356005)(2616005)(478600001)(82310400002)(83380400001)(82740400003)(4226003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2020 13:21:41.0803 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fbd53355-6187-48c7-0ccc-08d82fd480af 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: AM5EUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5248 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Fri, 24 Jul 2020 13:21:46 -0000 Segher Boessenkool writes: > Hi! > > On Fri, Jul 24, 2020 at 09:01:33AM +0200, Andrea Corallo wrote: >> Segher Boessenkool writes: >> >> Correct, it's a sliding window only because the real load address is not >> >> known to the compiler and the algorithm is conservative. I believe we >> >> could use ASM_OUTPUT_ALIGN_WITH_NOP if we align each function to (al >> >> least) the granule size, then we should be able to insert 'nop aligned >> >> labels' precisely. >> > >> > Yeah, we have similar issues on Power... Our "granule" (fetch group >> > size, in our terminology) is 32 typically, but we align functions to >> > just 16. This is causing some problems, but aligning to bigger >> > boundaries isn't a very happy alternative either. WIP... >> >> Interesting, I was expecting other CPUs to have a similar mechanism. > > On old cpus (like the 970) there were at most two branch predictions per > cycle. Nowadays, all branches are predicted; not sure when this changed, > it is pretty long ago already. > >> > (We don't have this exact same problem, because our non-ancient cores >> > can just predict *all* branches in the same cycle). >> > >> >> My main fear is that given new cores tend to have big granules code size >> >> would blow. One advantage of the implemented algorithm is that even if >> >> slightly conservative it's impacting code size only where an high branch >> >> density shows up. >> > >> > What is "big granules" for you? >> >> N1 is 8 instructions so 32 bytes as well, I guess this may grow further >> (my speculation). > > It has to sooner rather than later, yeah. Or the mechanism has to change > more radically. Interesting times ahead, I guess :-) Indeed :) > About your patch itself. The basic idea seems fine (I didn't look too > closely), but do you really need a new RTX class for this? That is not > very appetising... Agree, OTOH I'm not sure about the other options on the table and their impact, the advantage of this is that the impact is relatively contained. Andrea