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 E17053857C4F for ; Thu, 16 Nov 2023 21:14:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E17053857C4F 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 E17053857C4F 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=1700169292; cv=none; b=Z7G7aPOwyLXPdQrIqUqjTKoZPSTnmQxfV6RoGJRtW6KuNwV2QLJ2DrETpzV+3X5Wa6aVUWII3y4bQBc7DvS4eNCqF9MVg3sUezYn/fG0AhptnWhrz3351Vub7ag/LqXg2ftiFxxDLb+3vukxeBJRXeViOjRK5dwD0TWBLKeVlvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700169292; c=relaxed/simple; bh=5dxnuFMHM2IwoVNtxhecu0zmLSOHeG9MO0frIGbE/DQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=sQIjRwks2KjeEeDFEMQlYK7I23Ut5N+EvEC1mRBXLdqzDUPaimOdFQOjEwPwSMSJ8GE+3FFwQgd1Uz5g/Yjp3AFrs5CgUTzkg9SpJQfFY03OSuYzks6WzcHfmtyycEp960iWHO7JACZitXqtrHf2JzR3TilQpBxcATvcpvKe/Lw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700169291; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aDMTJ8EycTEy+yMJjN7ZfU5lq3zrgC9ef8LBE3AJBlc=; b=J6zbE7omenVEKBdazMyt8KG3bl+9gz0YKgQH8o6YGkOOiGXw2vXkPbbf6WTk3HeomKj6Of 13vIiJgcFM8gm9J8zhv+aj0dbmh/hsqDlbDop84S+AVudy8PcwYOMY19HCvVAoMcveG4kD YZcRdx+GLyiNAot47YrQyL3jXTuJS50= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-607-ETo2ism8MYq2rFOJzdr1Iw-1; Thu, 16 Nov 2023 16:14:50 -0500 X-MC-Unique: ETo2ism8MYq2rFOJzdr1Iw-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-778915a0c73so128381985a.1 for ; Thu, 16 Nov 2023 13:14:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700169289; x=1700774089; h=content-transfer-encoding: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=aDMTJ8EycTEy+yMJjN7ZfU5lq3zrgC9ef8LBE3AJBlc=; b=hEa27XsD4ioU3PX7yADLJG0z1kQa80VfrKgig492y1M/Mk/vcRPOo7TvGX2AaIBbRM bqnKJWB5AU3vfKsJrkFWKaxjWW3F8ceF7SliM3BY6hlVZA3cG4Qkd8U8d3rVnRMcYKH5 9VMXkXSNoVGNI7xxWDg2Y+hfAH3c2gCjdA9EO5LXknMtYDZMqWPiUuTMSd24AwnuSYBZ tBVL4TRVI1n+Kl6FC6jMQae5o4OPEduHAlD+hfKXkQFWPW8u+L0rw99t/p7K1Xt9JnsG PkjoIpkJ+2DpJftz5Ir178dXIPYyBaBO1juFKXs0EFfNF5UVKLU/wiunpU3ucTC+JGLw WTCw== X-Gm-Message-State: AOJu0YwrrZZlRIlV+K0gk91pkwdbZGtQ366ApHNN2LP5QbhpBEw1J0xX kxIvQtq1DVzAArK5jBQrfkHIWhd/bnhtTP9sCR15VkGHmDKNpZnSrSQYuHd/yfgLrWT71ERqyC3 XOfgv1JxS41l6rbbNM8LpHxgMrw== X-Received: by 2002:a05:620a:897:b0:77a:148a:3d69 with SMTP id b23-20020a05620a089700b0077a148a3d69mr10435936qka.43.1700169289190; Thu, 16 Nov 2023 13:14:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+WocMxUMLax8Sya3pBv0Lrz8yqA8nEgMun+4prdCo86ZOy3wczaL+lOWYMi/equhC/zbXHQ== X-Received: by 2002:a05:620a:897:b0:77a:148a:3d69 with SMTP id b23-20020a05620a089700b0077a148a3d69mr10435923qka.43.1700169288944; Thu, 16 Nov 2023 13:14:48 -0800 (PST) Received: from [192.168.1.88] (23-233-12-249.cpe.pppoe.ca. [23.233.12.249]) by smtp.gmail.com with ESMTPSA id i16-20020a05620a249000b0076e1e2d6496sm95695qkn.104.2023.11.16.13.14.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Nov 2023 13:14:48 -0800 (PST) Message-ID: <3c9d365d-1990-3832-86b1-8b0804d9d5a0@redhat.com> Date: Thu, 16 Nov 2023 16:14:47 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH V3 5/7] ira: Add all nregs >= 2 pseudos to tracke subreg list To: Lehua Ding , gcc-patches@gcc.gnu.org Cc: richard.sandiford@arm.com, juzhe.zhong@rivai.ai References: <20231112120817.2635864-1-lehua.ding@rivai.ai> <20231112120817.2635864-6-lehua.ding@rivai.ai> From: Vladimir Makarov In-Reply-To: <20231112120817.2635864-6-lehua.ding@rivai.ai> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/12/23 07:08, Lehua Ding wrote: > This patch relax the subreg track capability to all subreg registers. The patch is ok for me when general issues I mentioned in my first email and the issue given below are fixed. > gcc/ChangeLog: > > * ira-build.cc (get_reg_unit_size): New. > (has_same_nregs): New. > (ira_set_allocno_class): Adjust. > ... > + > +/* Return true if TARGET_CLASS_MAX_NREGS and TARGET_HARD_REGNO_NREGS results is > + same. It should be noted that some targets may not implement these two very > + uniformly, and need to be debugged step by step. For example, in V3x1DI mode > + in AArch64, TARGET_CLASS_MAX_NREGS returns 2 but TARGET_HARD_REGNO_NREGS > + returns 3. They are in conflict and need to be repaired in the Hook of > + AArch64. */ > +static bool > +has_same_nregs (ira_allocno_t a) > +{ > + for (int i = 0; i < FIRST_PSEUDO_REGISTER; i++) > + if (REGNO_REG_CLASS (i) != NO_REGS > + && reg_class_subset_p (REGNO_REG_CLASS (i), ALLOCNO_CLASS (a)) > + && ALLOCNO_NREGS (a) != hard_regno_nregs (i, ALLOCNO_MODE (a))) > + return false; > + return true; > +} > + It is better to fix the problem source.  But sometimes it is hard to do this for all targets.  RA already has analogous code.  So it is ok for me.  The only thing is that it is too expensive to do this for each allocno.  You should implement some cache (class, mode)->result.