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 2AE4B3858D20 for ; Tue, 30 Apr 2024 21:48:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2AE4B3858D20 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 2AE4B3858D20 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=1714513711; cv=none; b=rc1C9rTCYl54iPECOTnkOE61QLqFOc9KscuKjW2qdG8Lnay7hEl0OzqYQ/RQ6ndOstmTx6mXhgPdDkCqq8hsb5jAX9cNNvm3Kph40pDawYy6hUNf8cgk2hiopI0WW/sB8OYeYE0/4H+QN/cGDQ9L81GmTGHR0rnpSILOK38/p5M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714513711; c=relaxed/simple; bh=fqJdvJSjG1worRIKh11rimRtkskVsvk8xHpvFTlJQeY=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=gUo69bN9153ew8VXa+js7yHtErBYab/ZlWJqI5dqs6rAmBrGHDMBcMaDjWu8vFGUKuBTJWUYt4eV/S6Le6teYK7xq0juxGIwweGHRDo6TSmc0El3bRtH/IHIJhJ5i06CwcD2uoTjhJLfvAFLYC8JeZbwpvMvZAxTpIUuXZiPASU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714513709; 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=g0po3RF+yohxROKW9lkZE1VeKiuUjMEDPZ0+/qT1if3sGMD70VFZH5iLQtbHIBxqpSg7Hp rx03iaGdPj1C3TYeqEaBupBDdRZRg1POT1GFTujPKSTyBqgomqLaBknNiNjHYKPj4wFTxQ SGtWbXOJpXN8J8AC/s+Ryax56g5BWTQ= Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-373-o0IXb4FxOXCCzLLgLcXTuA-1; Tue, 30 Apr 2024 17:48:28 -0400 X-MC-Unique: o0IXb4FxOXCCzLLgLcXTuA-1 Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-7f1a30f832cso532521241.3 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=Z1jxmNq2AFUu5IAdXMzZSqr/mvTuPxOk4MjQZ6W3HNTBb345YPxfJ8zwEdfgAyaiuk 4qgfgT5vw4+UwrapFUoz57qseFIO/ivHr7yI6smidkZLk70mLp4lDsoK+IKwlK3vd+JT M7ajHY3uWoBKqgLIhIRyQ8NQOhdiZrksz/jmxVnq6DU8rfWjeL1LN6BxmYJBy2Y+tHH3 vbpeVppZ3jxdyt9EH1wFSY5LpZcEpWujprnexgao4Au1+w0fUcyRV1niBNVm1L4Imoj1 kr2YCQF6tIhXHijxVynBWKXdx+mT3DYbN/YCP3DyKicMgK5gvkbPb4BwXXiF9c8tn92B MKXA== X-Forwarded-Encrypted: i=1; AJvYcCUBHcLBNy5AeHE7KcsVmckIi8FelA9uJOWPmtFK1U0VoeJAl9yXu9/LgHt3h0s67Q9dSBG2mWLQgF36TBYy6jw= X-Gm-Message-State: AOJu0YyYPR7CXfAszAKglETYSPwQcx4rkoSIS69ZCCtzzjHPuhYVJKH7 jwXtaxWsiQ5qxWTTaojBcXTP2887SddwduH3YHzGIXysKuUMHMaewfNe7fh/vZjq5i8d+I1Y3HE yJBUCWoyLHO/34V8MnuDkcBD2veTNMnwHPZtRLTD3K5HK X-Received: by 2002:a05:6102:495:b0:47a:2ff9:d059 with SMTP id n21-20020a056102049500b0047a2ff9d059mr885062vsa.21.1714513707949; 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=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, 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