From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by sourceware.org (Postfix) with ESMTPS id BB3093858D20 for ; Fri, 20 Oct 2023 11:47:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB3093858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BB3093858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697802449; cv=none; b=XK23SzxRGtsnsVibkOpZ0lZJHw9vUsJyKxHJm/mU4XIglvPcN7zpdF93ooXXdjZuUv7lnEEs+aYzwf9jKTYT9pQrQRpvt1VKNuKoC8BQT6Kt4QhlhBmsXli7HpGrQweihp3qAQd++qpggqigvk0DgFh1kOp8y9/H5eWJ51XR9hA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697802449; c=relaxed/simple; bh=mi1w3V55xNAFfgsbp/T/8P/lNNbIjxNEySuSz9jRY+w=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=ICGh/1VRje8WJmGa0xq64F06/kCKkYrX5TyQKL31M+qzo61UYRgC3qtRh9mFUxX9kZojhJ7rgizmwFMs7+fiVK5L35/isK5KXS94WS5XdA6XVC38tzktdTSRMyfqauCa3kzYRrh7CNbFCsl/X4Ce50441WnQ0zdrJBVgK5DkLQk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-507975d34e8so1004051e87.1 for ; Fri, 20 Oct 2023 04:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697802446; x=1698407246; darn=gcc.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=4hn0ifAuRW8LLZWppDuXUoMCV+7p/ker0SYBnMezg68=; b=NB226kyMPC8yqUE6hY/Bde5QzsKEtZ8kcgXcKpSwVhD/rDM+2X85gHQpyf1DOn3vDn VXaPrxAJuJg4PWZZOf90KEUddk1wkSteBeVSs3aPkhooPgqjbjHgf8tCRpWwN7JMhNRs gb7lrRhOZQK9me27hCzQCITNE7Kr41lY31jKLcU9LwCAfunu3uHssrqdYgm1GXPcJUDP UtDai8ddEFnlJhMWY5rEZ3xrAKvxht6LgkKydpkT+QJdHVGDbWuofoLEgj6eYs0S9MrN Nj44TB4cmda9eWqCHHI2tnUQAPa9feTpwsQ02waLUghvT7MkXlLlhwr6WvaXNQheYcBR 88+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697802446; x=1698407246; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4hn0ifAuRW8LLZWppDuXUoMCV+7p/ker0SYBnMezg68=; b=O3+5w/3SeBVEAnN72qXytnVdd3pd3En/7SfWoLVwY/0lV9yWLeH+C2VpwSxy5DyE2N jZCwQqUTR2sGQX6/2/VnXp8tdkWFyuLOwAd8+8RyhcfwsKFrhK2PD96tgj89M0jXcG7q 4LgPKlTdrMFn+++X9uU+L5Xev/V+/t9rsX1A04QdyM7cbOuIMG85NlcVHs1otKfEmwC3 VmIDZht2Wb4NjDp/7Vf+SxKLjKfPcrKeKDFkob4NRLWHQyZOlP5PDOWApYlFC1Sj+PHd Kmn0sl7YEHEbkFZ+/A1trtRRjMfkTz3WkKDeWkZn2YZBXbnjfdgy2yIPQZ6WqWfKRps6 f1aw== X-Gm-Message-State: AOJu0YwmvmRssSqSZjppp/p70NbNVto6fewmEB7RPZmZgXfLWLuMQq/p vymmuBYSt6koppzVv/HAsDpYshbkKg9ZjH5XtuZ5cNtpNDBK2A== X-Google-Smtp-Source: AGHT+IEehj4whZjgBr8KSeUtbf4C8yGupUtzkW58n+Pg5hnYHOzDfSyjoy3o9s469eFWgGE8onn2kKH7QqwwD0eTs2k= X-Received: by 2002:a05:6512:3b85:b0:4ff:7f7f:22e7 with SMTP id g5-20020a0565123b8500b004ff7f7f22e7mr1282122lfv.17.1697802445357; Fri, 20 Oct 2023 04:47:25 -0700 (PDT) MIME-Version: 1.0 From: Hanke Zhang Date: Fri, 20 Oct 2023 19:47:12 +0800 Message-ID: Subject: Question about the pass_fre about merging if blocks. To: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,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: Hi, I'm trying to make pass_fre work better for me. But I got a problem. Like the code below: int glob; void __attribute__((oninline)) foo() { // do nothing meaningful } int main() { if (glob) { foo(); } else { // do something that won't change glob } if (glob) { foo(); } else { // do something that won't change glob } } I'm trying to merge the two if blocks. And of course it won't work. I see the code in tree-ssa-structalias.cc, it will do this check: static bool pt_solution_includes_1 (struct pt_solution *pt, const_tree decl) { // xxxx if (pt->nonlocal && is_global_var (decl)) return true; // xxxx } So the pt->nonlocal will prevent the merge. I would like to ask if I can make this check less rigid by providing more information about function foo(). Because obviously the foo function does not change the value of glob here, but it is caused by the fact that it is noinline. So if I can prove that foo won't change glob and pass this infomation to this check, my goal was achieved. Is this possible? Thanks Hanke Zhang