From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 73D563858D20 for ; Wed, 1 May 2024 16:24:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 73D563858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 73D563858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714580677; cv=none; b=soG2pbfnqE5VBXPjBKxpFnogqCaMvMhoFGiuJ/nb1PWhvAQNQIRPPavSUMS1jLm+H3HtlwT0LQTeGqW4BFYncQc1gMt/7lSMIZ5XB5WAfSvUrclh/TUVVOy/NGyiC1BgX6tBhh6LUm1a5zOyQ9zTj6jKLy59jyzW6oHWdCngLug= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714580677; c=relaxed/simple; bh=jV4/Wr88q9KyVicCqoGso5K9QkGuY4zZXccSoiO46FA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=HakdSW5zGtJyQE139GPRbNIqEueFJRoVUIN9b2ZG83fRdhQbriqdW54/1Am4MLL/IBpQbRn+DkThWqOPLjdrSd5yEpJkKupTsKjqBBhmpCmeNg1L3GNZZO3FQBvVPZ0uO9728/THs0HLstNtz3+is/bzkBVw5YO0BZqmYRvOaDU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714580675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VkUCDyvfyWOjctBHCKzw8ckLCO8d3ByKMhVaL/sTZOU=; b=goqSVkfzrpXLMdgw+LivUH+uT13jcqP6tsLhk5kZ1FXYgR0rx1EnAwyTsGhAbtK+7stBxj Vh62w6pxRDHG2qK4sb16cJr5AEUUKWvK+hE7D97hcfKQgm19P86OJjuV9cPiGM9dMYBcff f9peWR/4DTU8ITXh7/4APDoltSpuqMw= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-121-34Ao-cHqMvKXX4MPW6NUsw-1; Wed, 01 May 2024 12:24:33 -0400 X-MC-Unique: 34Ao-cHqMvKXX4MPW6NUsw-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-78d5fed0e1aso737927285a.2 for ; Wed, 01 May 2024 09:24:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714580673; x=1715185473; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=VkUCDyvfyWOjctBHCKzw8ckLCO8d3ByKMhVaL/sTZOU=; b=cSZ5JmNKxnHrGIys6N9NyqrZgZd1ZMhkPDszl9EDqa9cZPBXLPODJirwwjIAV8UqDS ZMvCcruZqnAqwAbnv6pdohAMY8leiOIDi/mK4e0qNQXJ/1xPMwIwDC5/n6hUnUvhzJmK Bc+9Zkitc48OFAqU+mTU9Or3QMR6Ejs/QpdvVDR0Se9NeRugSoKpOaT3XTVOcHhyEpQc WUHx1OUiUeH5Fkvd/cGvTeXkqHU0cIitUZCDfCmzxWvtD5U27s9WtngtWFq196oc4WdF Imc3VoJscPrhghM5ni8PNapOzg9LodQtmFWa8J/wtHkjUF9CJuvQHgZeVDwMlfecyfhC cPug== X-Forwarded-Encrypted: i=1; AJvYcCXQSEj7yvP6uzJBF/+zaNETt/4RHOLzOqHIHBccmM9k/ufaBU5h60sb4Tg38HHxBQJSTU65ATohDdThS+o1KMODS8iUbkVLeQ== X-Gm-Message-State: AOJu0YxKDAlArc1bhjqSDhYnydah8jZ38eFQuNnguOtfrOjScx6Olttu /MqyLykW9Ty+GZD+eA7b13Qj4BiH3gcqvpPus+XHVE56EriJfd3FhQGVH/ua4dbIlarJaG0/XNJ XY8hvJPtVgBGaWnGIxPBhjq5lbKLnHz7jpFBtOU+fWPCBL4QLWIbCfxC0MKkcyvIxmA== X-Received: by 2002:a05:620a:845:b0:790:c7f9:4639 with SMTP id u5-20020a05620a084500b00790c7f94639mr3091570qku.3.1714580672614; Wed, 01 May 2024 09:24:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6LVir7nog+FTbaw+V85NrZyPUXuGneNtoNldTWvGMfA+wlcVrFW6mTcLZwM1cDyTdvBTVww== X-Received: by 2002:a05:620a:845:b0:790:c7f9:4639 with SMTP id u5-20020a05620a084500b00790c7f94639mr3091543qku.3.1714580672164; Wed, 01 May 2024 09:24:32 -0700 (PDT) Received: from [192.168.1.107] (23-233-12-249.cpe.pppoe.ca. [23.233.12.249]) by smtp.gmail.com with ESMTPSA id l22-20020a05620a0c1600b007907ef72e1dsm8129803qki.36.2024.05.01.09.24.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 May 2024 09:24:31 -0700 (PDT) Message-ID: Date: Wed, 1 May 2024 12:24:30 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] lra: Apply DF_LIVE_SUBREG data To: Lehua Ding , gcc-patches@gcc.gnu.org Cc: richard.sandiford@arm.com, juzhe.zhong@rivai.ai References: <20240203105012.208998-1-lehua.ding@rivai.ai> <20240203105012.208998-5-lehua.ding@rivai.ai> From: Vladimir Makarov In-Reply-To: <20240203105012.208998-5-lehua.ding@rivai.ai> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="------------nDQrlzvV0f9tfBlPvHFFRF8k" Content-Language: en-US X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is a multi-part message in MIME format. --------------nDQrlzvV0f9tfBlPvHFFRF8k Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/3/24 05:50, Lehua Ding wrote: > This patch apply the DF_LIVE_SUBREG to LRA pass. More changes were made > to the LRA than the IRA since the LRA will modify the DF data directly. > The main big changes are centered on the lra-lives.cc file. > > gcc/ChangeLog: > > * lra-coalesce.cc (update_live_info): Extend to DF_LIVE_SUBREG. > (lra_coalesce): Ditto. > * lra-constraints.cc (update_ebb_live_info): Ditto. > (get_live_on_other_edges): Ditto. > (inherit_in_ebb): Ditto. > (lra_inheritance): Ditto. > (fix_bb_live_info): Ditto. > (remove_inheritance_pseudos): Ditto. > * lra-int.h (GCC_LRA_INT_H): include subreg-live-range.h > (struct lra_insn_reg): Add op filed to record the corresponding rtx. > * lra-lives.cc (class bb_data_pseudos): Extend the bb_data_pseudos to > include new partial_def/use and range_def/use fileds for DF_LIVE_SUBREG > problem. Typo "fileds". > (need_track_subreg_p): checking is the regno need to be tracked. > (make_hard_regno_live): switch to live_subreg filed. The same typo. > (make_hard_regno_dead): Ditto. > (mark_regno_live): Support record subreg liveness. > (mark_regno_dead): Ditto. > (live_trans_fun): Adjust transfer function to support subreg liveness. > (live_con_fun_0): Adjust Confluence function to support subreg liveness. > (live_con_fun_n): Ditto. > (initiate_live_solver): Ditto. > (finish_live_solver): Ditto. > (process_bb_lives): Ditto. > (lra_create_live_ranges_1): Dump subreg liveness. > * lra-remat.cc (dump_candidates_and_remat_bb_data): Switch to > DF_LIVE_SUBREG df data. > (calculate_livein_cands): Ditto. > (do_remat): Ditto. > * lra-spills.cc (spill_pseudos): Ditto. > * lra.cc (new_insn_reg): New argument op. > (add_regs_to_insn_regno_info): Add new argument op. The patch is ok for me with some minor requests: You missed log entry for collect_non_operand_hard_regs.  Log entry for lra_create_live_ranges_1 is not full (at least, it should be "Ditto. ..."). Also you changed signature for functions update_live_info, fix_bb_live_info, mark_regno_live, mark_regno_dead, new_insn_reg but did not updated the function comments.  Outdated comments are even worse than the comment absence.  Please fix them. Also some variable naming could be improved but it is up to you. So now you need just an approval for the rest patches to commit your work but they are not my area responsibility. It is difficult predict for patches of this size how they will work for other targets.  I tested you patches on aarch64 and ppc64le. They seems working right but please be prepare to switch them off (it is easy) if the patches create some issues for other targets, of course until fixing the issues. And thank you for your contribution.  Improving GCC performance these days is a challenging task as so many people are working on GCC but you found such opportunity and most importantly implement it. --------------nDQrlzvV0f9tfBlPvHFFRF8k--