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 7DD5B3858D34 for ; Tue, 30 Apr 2024 21:48:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7DD5B3858D34 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 7DD5B3858D34 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=1714513715; cv=none; b=Lz91yFj3vjMtZ9qn5HyvHUmL9VJVVUp7PR6VvJHzyOh2BsM5yZczJH9lpf38PqrmfKm+XgLbi1oPqV5VY8R7hPD0vlpVWHBNzDejvTa7Vy7a8ZvhNx14yOetG6EoByXDDSqyZnTdtn+PdUWdN3HOYZSXrD687tYKvz2nq+GswCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714513715; c=relaxed/simple; bh=fqJdvJSjG1worRIKh11rimRtkskVsvk8xHpvFTlJQeY=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=rhR8lanR3WbbH24iFxGRNjeNBh96f9J7vY0fr/kJBvL5WLCHh5VfNEtQe0OnlEJU9hTQOddUx5pe92nD9gjCMrjiZbmj8shl+DvHe7jIJaQXKIe3IFC9dJlh3BJkgemFIEa/DnuJd4bX04AZWpLXGTdqFH+NVpkURM5wEYf5ViA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714513711; 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=K2aBIVAV8Bk7ckCywSZiznRLW2uQlZ9Z7zIMa5sWQ2k=; b=aWzT5im8diUviCz3S0cDpwRx7Lcpq9SQ6tV3edCeMYk/wMSCs3WIK7etG/QLYqLcr43gVw HL2Ol7pZj3vtQFdGiMVx8j0iQSUN4jbgaiMbvI5kcKdwIa45JVcf81nwVvmg73vMa9de0c ShOboUBbfDvaB9dExk4sNy3gktBNrV4= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-tPSK9601NH2TedXxx0ZuHQ-1; Tue, 30 Apr 2024 17:48:28 -0400 X-MC-Unique: tPSK9601NH2TedXxx0ZuHQ-1 Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-47c338f5c19so1171026137.0 for ; Tue, 30 Apr 2024 14:48:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714513708; x=1715118508; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=K2aBIVAV8Bk7ckCywSZiznRLW2uQlZ9Z7zIMa5sWQ2k=; b=hZsXn5gZfFGvu3ir73raqdBx5f0aaDut8xqVzqlaD+X8A6LP/E9wj6HckP3jEL9eZz V7fiT+C75SSOAs4yjptRsxApta1frO2H1l5abJbgtLna2rawiLoiOGLUFkKgpNOG2TtQ gaaaQegM/hLdc86sNyLw4Is4C8jNTjAbnYKGPNudU+2rcfiYHPKObcZZSYoUiJXhjou/ IqtbU3QzSjzpaQsxUauYyhv7I3S1g10y2+J7TiY2L8B7cpfCW6xmCPUANWj14ZZ5Gv9M M4o/DGHTlJ4ug+WRp25YZxAVueppue2iNergY4CpCCA7I9QIoegRQQYnxon1KAH2ACer YGxA== X-Forwarded-Encrypted: i=1; AJvYcCU1MhhulqaZxgrleZhKrjk7tV19uECEUrFnuOQ6kvULH1vHz+AnIiLZH+RH6f9H1feAqM4VYejGvnLLrjw4LZs= X-Gm-Message-State: AOJu0Yy38NumX/AMXKJW5PsYgE8f/rw6hQW3idRES8Ahvd+uttGiHbzA UkQGnOHnc86ra21gYv7danb+l0OXGqEdDNgX01axe15n8s0J9FezYpSYXSxRkJRnPiAcFGRPrTt OdnTDOAAvD4qD7MMjAMBOuxS8J62z2CdPX5ZST9Dmfags X-Received: by 2002:a05:6102:495:b0:47a:2ff9:d059 with SMTP id n21-20020a056102049500b0047a2ff9d059mr885067vsa.21.1714513707979; Tue, 30 Apr 2024 14:48:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9Axqg8oTTnpuaLEejk5Q3Wz8HuzvisPImjqWAu5fPmZ8EjDj6FbrgY1v+yOeGjHd/RdbRzA== X-Received: by 2002:a05:6102:495:b0:47a:2ff9:d059 with SMTP id n21-20020a056102049500b0047a2ff9d059mr885049vsa.21.1714513707687; Tue, 30 Apr 2024 14:48:27 -0700 (PDT) Received: from t14s.localdomain (syn-067-242-169-067.res.spectrum.com. [67.242.169.67]) by smtp.gmail.com with ESMTPSA id mm22-20020a0562145e9600b006a0d9ae2540sm1391027qvb.105.2024.04.30.14.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 14:48:27 -0700 (PDT) Message-ID: <342ee000a97aa485f4f1d83d880bf9af80eae11e.camel@redhat.com> Subject: Building libgccjit with -fno-semantic-interposition? ( was Re: 1.76% performance loss in VRP due to inlining) From: David Malcolm To: Richard Biener , Jason Merrill Cc: Aldy Hernandez , GCC Mailing List , "MacLeod, Andrew" , Antoni Boucher , Andrea Corallo , jit@gcc.gnu.org Date: Tue, 30 Apr 2024 17:48:25 -0400 In-Reply-To: <179E65E4-33E7-45F1-A7B3-755CA434D037@gmail.com> References: <179E65E4-33E7-45F1-A7B3-755CA434D037@gmail.com> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable 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, 2024-04-30 at 21:15 +0200, Richard Biener via Gcc wrote: >=20 >=20 > > Am 30.04.2024 um 21:11 schrieb Jason Merrill via Gcc > > : > >=20 > > =EF=BB=BFOn Fri, Apr 26, 2024 at 5:44=E2=80=AFAM Aldy Hernandez via Gcc > > wrote: > > >=20 > > > In implementing prange (pointer ranges), I have found a 1.74% > > > slowdown > > > in VRP, even without any code path actually using the code.=C2=A0 I > > > have > > > tracked this down to irange::get_bitmask() being compiled > > > differently > > > with and without the bare bones patch.=C2=A0 With the patch, > > > irange::get_bitmask() has a lot of code inlined into it, > > > particularly > > > get_bitmask_from_range() and consequently the wide_int_storage > > > code. > > ... > > > +static irange_bitmask > > > +get_bitmask_from_range (tree type, > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 const wide_int &min,= const wide_int &max) > > ... > > > -irange_bitmask > > > -irange::get_bitmask_from_range () const > >=20 > > My guess is that this is the relevant change: the old function has > > external linkage, and is therefore interposable, which inhibits > > inlining.=C2=A0 The new function has internal linkage, which allows > > inlining. > >=20 > > Relatedly, I wonder if we want to build GCC with -fno-semantic- > > interposition? >=20 > I guess that=E2=80=99s a good idea, though it=E2=80=99s already implied w= hen doing > LTO bootstrap and building cc1 and friends?=C2=A0 (But not for libgccjit?= ) [CCing jit mailing list] FWIW I've no idea if any libgccjit users are using semantic interposition; I suspect the answer is "no one is using it". Antoyo, Andrea [also CCed]: are either of you using semantic interposition of symbols within libgccjit? If not, we *might* get a slightly faster libgccjit by building it with -fno-semantic-interposition. Or maybe not... Dave =20 >=20 > Richard=20 >=20 > >=20 > > Jason > >=20 >=20