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.133.124]) by sourceware.org (Postfix) with ESMTPS id 3C3ED3858D3C for ; Tue, 23 Jan 2024 12:43:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C3ED3858D3C 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 3C3ED3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706013838; cv=none; b=ZrLawArl6+O49TfxJGYBvnjWi0dU7iNn2ONMoEhPpGcp3Ro3CrmCyB9WrrfIz+/k4DafIcYfX7z1mOz7IJEDIGh2EzIqupibmYlrxsUeB15bAyRkBtysC7Yw0n/xLggI35jtXkP63Jy0bndM868KmSovwKY+ud+JFnXds2oV5G8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706013838; c=relaxed/simple; bh=me+bFXbdyAmpmTLK18eyOg0DonWfoooBCXqVFGgTu4o=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=CvnCs9Bnn23jII/dSgSivYdKzeRSXxdwWoqWhoa1EesIk+hRFZo0BmLiC5XUl9zYyDhwpq6Wq8dKWrpmFDuws3EHTfvzxOYFmZ2ESgj1sRtciv+EEQhui2TroHMFUIuToP0Q+tfZuej6HXhylwju848y1R8XxT1fCjfQGN4L3sI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706013835; h=from:from:reply-to: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=1eg725XQLNseqEJslQF1ZZTF2WlqAux1U69Aashwrgg=; b=gAKlviwiEzOtXAwCy0DUvyONPXEa6zHH4IGm5cessMrAHtiPvXCi7lm535sk3B1I359RF9 ao/ikrfxdl7AfnFq4LbSZS18571aEMZMnegdQ0Xf+kHL+DshiXHZZWSDavZWEfKRBgKnKW cUTFzEH3w7pYYGotCLaBvG1lI5oYGOU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-228-RvoUkLZqOX6eWyAJm8jShA-1; Tue, 23 Jan 2024 07:43:54 -0500 X-MC-Unique: RvoUkLZqOX6eWyAJm8jShA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C5F11C03D81; Tue, 23 Jan 2024 12:43:54 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D347F492BFA; Tue, 23 Jan 2024 12:43:53 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 40NChpiJ1610763 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 23 Jan 2024 13:43:51 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 40NCho531610762; Tue, 23 Jan 2024 13:43:50 +0100 Date: Tue, 23 Jan 2024 13:43:50 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] tree-optimization/113552 - fix num_call accounting in simd clone vectorization Message-ID: Reply-To: Jakub Jelinek References: <20240123115653.47E5C136A4@imap1.dmz-prg2.suse.org> <96o9o1on-0523-6s9p-n00q-o7qn476p0470@fhfr.qr> MIME-Version: 1.0 In-Reply-To: <96o9o1on-0523-6s9p-n00q-o7qn476p0470@fhfr.qr> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,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 Tue, Jan 23, 2024 at 01:40:15PM +0100, Richard Biener wrote: > It's never going to be 3 vs 2 but 3 * 2^n vs. 3 * 2^m so floor or > ceil doesn't matter. In fact we could have just using > some inverse of exact_log2 (n->simdclone->simdlen). That is, > it's only simdlen that's varying in this addend to this_badness. > > For the exact_log2 case the behavior is unchanged and we now only > get a sensible number for the others now. Maybe log2 was for the > fear of overflow or over-accounting compared to the other increments. > When overflow is not an issue we could also use > floor_log2 (num_calls * 4096) to be more "precise". I don't know > why we have all these different weights and why they are the way > they are - but it's a lot of apples and oranges we put together > in a magic number to compare ;) > > I prefer to do a minimal change now, but both floor and ceil work > for me, so if you prefer I can change (but as said, it would only > matter with the mixing with the other cost factors, and in unknown > ways since the desire is not spelled out). Ok as is then. Jakub