From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 63E9E3858293 for ; Tue, 8 Nov 2022 13:52:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 63E9E3858293 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x632.google.com with SMTP id 13so38842774ejn.3 for ; Tue, 08 Nov 2022 05:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aHAotOWdqj2p7DoKaX5+aC836PkrsijzPVqI9LkPZSk=; b=Ed/Ra43xb/N4kipHIS5JTA/DBasmZjHOwLQb8Zz2ESOO5FwPHk0uoDC0Plpt4Tt529 Ce13zbfVFHkT2QwWR1Ttdb9z37GouCl+8KOal6XHqDPFqTuf9ILrJzRblTYXIXkevKlM 13zbbOrXBhh7+8O06FWIGjLK5yun13y6DpeXrt1LzawpQZpi2lVWVwkEksWfrJv6cuaC NIM7YJhKpV4fL6EJ+tQO8F57p/pEBziUOTMAFnnir81l9wuYrBqhbtDIy06qKpbOFyA4 f0IVTm8M2EGcSMu4FcW0FsrY1uuOZ4aHlDGaDmYEUmRB6vK7uDKJYipzOK+wPnGOjDRF AEHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aHAotOWdqj2p7DoKaX5+aC836PkrsijzPVqI9LkPZSk=; b=Zjtrd+hfV8xRyTH+K9X5lokTm2DGjDPF9Al/vap35P+ILAs1/l68WkW3Cd3ybi4zE9 UC06UXATA1xPRjG10DBGb5rwIYM484sIapBNPD6/YRwITTK+NJLdJkgMIaAS7DaYCGrs 6dNVHdFlfvmeXyXEh49+vwGbMSEPWMAARFvGfyImhDoLgcRCZ1+LHi0OtiaJ/mWR2Jjm vqxt6tdCs7unnz4vVlPYZAd2C2QV4xFXMt2sY8yb66zMQRRVVenAdoS8iQSclATVgvRA +Ytku2yePGDkYq/NNrLEiQDicuj+bBCG30JCJfm4/qkT7W/hXUUtY3hcfj4/4eMokIG4 wMhw== X-Gm-Message-State: ACrzQf1D1SXwE5rSDPXY6OZyMSGQPSxWY1C0+/KxJPxzEptP+XhjnwBX ddOoaJNPAoKfbRZ4L1pFMt+EvpKmD95ftqkceTW5Sxpb X-Google-Smtp-Source: AMsMyM6qgYTGqKCFZl9KDq3AieACzohlZNtzulCgbJzf+HZ72DEtz8I376wWl8Y92TqX/H7cjxoIYnjstiHPUNghQnQ= X-Received: by 2002:a17:907:971f:b0:7ad:e232:f115 with SMTP id jg31-20020a170907971f00b007ade232f115mr41216837ejc.754.1667915539106; Tue, 08 Nov 2022 05:52:19 -0800 (PST) MIME-Version: 1.0 References: <13ec35ee-19b2-536c-42d9-28efcd01df5b@embedded-brains.de> <582f9b96-47e9-6005-8d62-fd209f979848@embedded-brains.de> <0b401a57-45f4-6a92-6073-54612a2e0add@embedded-brains.de> In-Reply-To: <0b401a57-45f4-6a92-6073-54612a2e0add@embedded-brains.de> From: Richard Biener Date: Tue, 8 Nov 2022 14:52:05 +0100 Message-ID: Subject: Re: -fprofile-update=atomic vs. 32-bit architectures To: Sebastian Huber Cc: GCC Development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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, Nov 8, 2022 at 1:00 PM Sebastian Huber wrote: > > On 08.11.22 11:25, Richard Biener wrote: > >> How do I get ((unsigned int *) &val) + 1 from tree addr? > >> > >> It would be great to have a code example for the construction of the "= if > >> (f()) f();". > > I think for the function above we need to emit __atomic_fetch_add_8, > > not the emulated form because we cannot insert the required control > > flow (if (f()) f()) on an edge. The __atomic_fetch_add_8 should then b= e > > lowered after the instrumentation took place. > > Ok, I am not a compiler expert, so I have just a vague feeling how this > works. I am not sure which piece is responsible for the "lowering" of > this particular __atomic_fetch_add_8. I guess we don't want to split all > __atomic_fetch_add_8 into this if (f()) f(); form? I think we should do it right after the profile instrumentation commits the edge insertions. And yes, we only want to lower those that are not natively supported (but have native support for fetch_add_4). Not sure how to determine this. > > > > > There's currently no helper to create a diamond so the canonical > > way is to create a GIMPLE_COND, split the block after this stmt, > > split the outgoing edge and then redirect edges to form a half-diamond. > > move_sese_in_condition has most of that CFG manipulation (but > > it performs sth different) > > Thanks, I will probably able to do this with a bit trial and error. > > -- > embedded brains GmbH > Herr Sebastian HUBER > Dornierstr. 4 > 82178 Puchheim > Germany > email: sebastian.huber@embedded-brains.de > phone: +49-89-18 94 741 - 16 > fax: +49-89-18 94 741 - 08 > > Registergericht: Amtsgericht M=C3=BCnchen > Registernummer: HRB 157899 > Vertretungsberechtigte Gesch=C3=A4ftsf=C3=BChrer: Peter Rasmussen, Thomas= D=C3=B6rfler > Unsere Datenschutzerkl=C3=A4rung finden Sie hier: > https://embedded-brains.de/datenschutzerklaerung/