From patchwork Fri Oct 25 11:51:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 2002320 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=emoc2jmE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XZlml6ldbz1xwF for ; Sat, 26 Oct 2024 01:39:51 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EBF593858405 for ; Fri, 25 Oct 2024 14:39:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id BE3523858D33 for ; Fri, 25 Oct 2024 14:39:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE3523858D33 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BE3523858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729867152; cv=none; b=Ij42ksZwfcPaY/W+Knpu71eAD3ghmRP6mFTqa0s4N7LNmKprylvQfJYIiyfpQQDgZkTjSiM8oV0y2vXAO107TVDga8DCmSivG+aO2uBSly1MSZhLvZpiq2dwjzAR7FjpbSluLRqGx0/Wt8jBFR+y1y47ip3XO+LoqfESv0j5uGE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729867152; c=relaxed/simple; bh=YFnEDrndROefegGxh8RtlMYNKBpqFM91jUOTM3mixtk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DzAuC5moQUZXEqoDvWMqmAYWsvm+TQLrk9MLlE+P2hqW2zBj+JZdRf7au88JBVinlA9e5eY70kCTRkilx7ijJJ4zMKR/NqQkwcdfa5rMg0ET5bNoBj3JkRSqywY452S2wNT7gc1cBDouo/c9CHrcifeWXAZ7HIB9fZZnljR3gmc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-71e49ef3b2bso1511615b3a.2 for ; Fri, 25 Oct 2024 07:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1729867144; x=1730471944; darn=gcc.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=3IyZt5mJMjdiEnuh4EeKQiE7Yrk8biPBjxrmTO15hcc=; b=emoc2jmEyoZJK9JSlmuiCcVOZpZKFrFkJgZufVgGzpQvtxNwlk4e1wIibk4AlSCiXt QceStmrgR92+3KA4WpYfibE6tkWRuGm9EFn1KFEyhYD9Oej9jMUcJ+0beO9kqq8oB0yr Wd+HbMwdTF4ATamCW3j5kkSYyoVzLlGgeHeM67+xmqhia6fvE9wni69rhFkNTmR+cGzf fbJLkuoBp2xIQm/g7rtIhMFsSinGxhRApvAc1ypO8OKabzck4oBBFpfotNO60VH2Gc74 pmYg59DtrCKnMlqRJqpD5GozfxY/1XKuw89eXPUrCooSNwmc1nPuDsBQhbJBKCeRVmTd K/9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729867144; x=1730471944; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3IyZt5mJMjdiEnuh4EeKQiE7Yrk8biPBjxrmTO15hcc=; b=sdPIyLuoqbeSa2khofWAqiaCiMw3QOO/UlXH/TBreIa0dgTFeu+fHzJBNesH6RVLHb 9gKsTeps3IKJ0fSPnGBc3GMIxeuj+8BNNlpYZB91Xj/x78pIOXRZG3+gy1QDvLVKGsDO bMeId3v0FxOJIYmVnx0NCssVN2aptLM+gQZuE8ic68ir6BEuzdy0VZPCSyNX1EQx5vl+ SDhVsHWBu2YiX6rfwBSfzZUA9qW6tdGTkG2so11sW8KDeyeGjpfsq4awVZBYIXQua3Js AgABQ+ym8cR5SlJFaLlutluuqpzevDly+QEYAjdMODeKCnT1Zg2kD/hWQanSy/KOW7dD wl/Q== X-Gm-Message-State: AOJu0Yzd4FtWZWfxxBR0GeHH8972NMDGLx7UJdYxW4ULK5AdKBMyIVFL T+ODcnI/pqxRciBwuyMpGYgtg4mOWFPbU39kSJBs1tXjIvSgvCTC2lKriLRvTzuoP8GRDlWJj5+ jAw== X-Google-Smtp-Source: AGHT+IEG/Gswr/tcWDli3UNDkp0Rg71AdGqCrXZDC8xVR4156Y8ubgbSQt+muNuDfMdAgNgTVjq6fA== X-Received: by 2002:a05:6a20:e617:b0:1d9:2be8:6e0a with SMTP id adf61e73a8af0-1d978bd5cc4mr12617775637.46.1729867144400; Fri, 25 Oct 2024 07:39:04 -0700 (PDT) Received: from free.home ([2804:14c:4d1:44a5::1002]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7205791d9basm1123267b3a.43.2024.10.25.07.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 07:39:04 -0700 (PDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 49PBpE4Y1633791 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 25 Oct 2024 08:51:14 -0300 From: Alexandre Oliva To: Richard Biener Cc: GCC Patches Subject: [PATCH #2/7] drop redundant ifcombine_ifandif parm (was: Re: [PATCH] fold fold_truth_andor field merging into ifcombine) Organization: Free thinker, does not speak for AdaCore References: Date: Fri, 25 Oct 2024 08:51:14 -0300 In-Reply-To: (Alexandre Oliva's message of "Fri, 25 Oct 2024 08:07:13 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org In preparation to changes that may modify both inner and outer conditions in ifcombine, drop the redundant parameter result_inv, that is always identical to inner_inv. for gcc/ChangeLog * tree-ssa-ifcombine.cc (ifcombine_ifandif): Drop redundant result_inv parm. Adjust all callers. --- gcc/tree-ssa-ifcombine.cc | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/gcc/tree-ssa-ifcombine.cc b/gcc/tree-ssa-ifcombine.cc index ed20a231951a3..0a2ba970548c8 100644 --- a/gcc/tree-ssa-ifcombine.cc +++ b/gcc/tree-ssa-ifcombine.cc @@ -401,14 +401,14 @@ update_profile_after_ifcombine (basic_block inner_cond_bb, /* If-convert on a and pattern with a common else block. The inner if is specified by its INNER_COND_BB, the outer by OUTER_COND_BB. - inner_inv, outer_inv and result_inv indicate whether the conditions - are inverted. + inner_inv, outer_inv indicate whether the conditions are inverted. Returns true if the edges to the common else basic-block were merged. */ static bool ifcombine_ifandif (basic_block inner_cond_bb, bool inner_inv, - basic_block outer_cond_bb, bool outer_inv, bool result_inv) + basic_block outer_cond_bb, bool outer_inv) { + bool result_inv = inner_inv; gimple_stmt_iterator gsi; tree name1, name2, bit1, bit2, bits1, bits2; @@ -693,8 +693,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, basic_block outer_cond_bb, ... */ - return ifcombine_ifandif (inner_cond_bb, false, outer_cond_bb, false, - false); + return ifcombine_ifandif (inner_cond_bb, false, outer_cond_bb, false); } /* And a version where the outer condition is negated. */ @@ -711,8 +710,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, basic_block outer_cond_bb, ... */ - return ifcombine_ifandif (inner_cond_bb, false, outer_cond_bb, true, - false); + return ifcombine_ifandif (inner_cond_bb, false, outer_cond_bb, true); } /* The || form is characterized by a common then_bb with the @@ -731,8 +729,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, basic_block outer_cond_bb, ... */ - return ifcombine_ifandif (inner_cond_bb, true, outer_cond_bb, true, - true); + return ifcombine_ifandif (inner_cond_bb, true, outer_cond_bb, true); } /* And a version where the outer condition is negated. */ @@ -748,8 +745,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, basic_block outer_cond_bb, ... */ - return ifcombine_ifandif (inner_cond_bb, true, outer_cond_bb, false, - true); + return ifcombine_ifandif (inner_cond_bb, true, outer_cond_bb, false); } return false;