From patchwork Sun Oct 29 16:40:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1856757 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; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=RpgWyu9f; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4SJMbq0ys9z1yQ4 for ; Mon, 30 Oct 2023 03:41:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F629386193E for ; Sun, 29 Oct 2023 16:41:07 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id E27A73858425 for ; Sun, 29 Oct 2023 16:40:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E27A73858425 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 E27A73858425 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698597656; cv=none; b=exHdRQACtBiHxIwZrD6dHPQLA2in2DsZl4gPGF3hJB23YYVN1oj0RdqRTAv5hFr61OahTsXTynDBb7asnZRHBjE8O2mtwFtU2QhvbjyehbX5GICS5bXLt47MrSkv8PSBYtI8ISRdsyhp3u+dsEryD6MmIzVnoKQZLGUTa6dcVM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698597656; c=relaxed/simple; bh=77w1xz5EocXUoxLz+iYkpMAuF8uexA5zL+6fufAHFdw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=UBLEIniT9HIuTsUlxeY26WRL9VnFF/SbDrfLMIdnAvxS9gZGJV2JeGNXzNuNN//bEB+sqKcwRCoG1tmC0Ec5Uav0Ff++hfJ94KNuaZDmLekMAlAVg2zIEjn1qJ1/ML3X/BYfsijLpB1YDMsDYjqdDpnLCa0tMf8AIEJjzsKJuq0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6bd32d1a040so3701490b3a.3 for ; Sun, 29 Oct 2023 09:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698597653; x=1699202453; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=73copGJUCmIC8b8tX4pH1lZ9d4hZlGCpEj4LgKZi+7Q=; b=RpgWyu9ff5lxQQ7EVdo04TT2yowWGBxZx8YkMacVYFTWqwoQG/UpaGGBM2Kl5j4cZZ RPLsV5WGoYQfE/w1iJ5R6gpWzblMDPRprwP1/We4asmunaBCkFYBu83B8LV8bkFKbnML SSP5uFGMuOlaBCUwP7VmRryXibYbA1zPKa8V6rGhfJ093mlO8/8569h3t0GX4FrHAsfY zdYTZqCBieApad1Eb1DSq6eVac5a9f+AG/gAQzpdoeW7lNWLe2KAGxBj/CtIxJNfHGUk eeP14YN2L+NeeM0NACTzluAQm42yEwQQLra9IX0gpEwOuLrKBjNPu9zAGYC+E86O14Vq hQGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698597653; x=1699202453; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=73copGJUCmIC8b8tX4pH1lZ9d4hZlGCpEj4LgKZi+7Q=; b=l5LQ+HiHGpj4NUhfzvsmt7jqXg4HRV/RoL0Hfp7vYDJwK2OPM2Q5IHRcB+TynYQ9t7 qTRm52Pq05GxEifV4Pwr1euT9aeapXKKW4RcLKt4cQnYpR+yGThha2NMGGD2bGj4HDsM 4eRiSnNduI9p0G5CLBBzsEXzQTbnXsSoxz3AFHqr/jFHOHBw1FK5UtA83b+RwR3AMS9s yVvbuoGBWgrhwmquhAnJK/BQO9IzavWbj9KfemyU9WRMvQa1E+aj6SVt9+0WrzKvct0L 8eBI3OswwsPFLg+Z6Ql03wfxKm2ZiOfUyOrH5j1PrEG5iOr0p8mnC7h1HGbp2uUboGf2 Nk0A== X-Gm-Message-State: AOJu0YwqgUQDE2NSznIh7DbmZ/0acPGuTzIC8iuUT/C1DnxNXuVdJfBS vV2DEpA/XuE/adtZ+kIU2IfWJTL3LP0= X-Google-Smtp-Source: AGHT+IHOkkDX2/GZM5pbCr4J6T0fXFpkrCTJqZUyi5rveIhuqpTNR95ybqEISqNkRUqgjifk+YajUw== X-Received: by 2002:a05:6a00:2e27:b0:6bd:b3b9:649f with SMTP id fc39-20020a056a002e2700b006bdb3b9649fmr12040284pfb.7.1698597653086; Sun, 29 Oct 2023 09:40:53 -0700 (PDT) Received: from xeond2.wrightpinski.org ([98.97.118.94]) by smtp.gmail.com with ESMTPSA id w27-20020a63af1b000000b005acd5d7e11bsm3591005pge.35.2023.10.29.09.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 09:40:52 -0700 (PDT) From: Andrew Pinski To: gcc-patches@gcc.gnu.org Cc: Andrew Pinski Subject: [PATCH 0/3] start of moving value replacement from phiopt to match Date: Sun, 29 Oct 2023 09:40:46 -0700 Message-Id: <20231029164049.994454-1-pinskia@gmail.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Spam-Status: No, score=-4.0 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 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 This set of 3 patches, copy what is being done in value replacement and puts it into match-and-simplify form. I will be rewriting value_replacement in phiopt to use match and simplify directly in the next few months but I thought getting these into match form earlier on can help improve code generation independently of that move. Note this does not add the absorbing_element_p optimizations yet; I filed PR 112271 to record that move. Andrew Pinski (3): MATCH: first of the value replacement moving from phiopt MATCH: Move jump_function_from_stmt support to match.pd MATCH: Add some more value_replacement simplifications to match gcc/match.pd | 53 +++++++++++++++++++ .../analyzer/inlining-3-multiline.c | 5 +- .../c-c++-common/analyzer/inlining-3.c | 3 ++ gcc/testsuite/gcc.dg/tree-ssa/cond-1.c | 17 ++++++ .../gcc.dg/tree-ssa/phi-opt-value-1.c | 17 ++++++ .../gcc.dg/tree-ssa/phi-opt-value-1a.c | 19 +++++++ .../gcc.dg/tree-ssa/phi-opt-value-2.c | 19 +++++++ .../gcc.dg/tree-ssa/phi-opt-value-3.c | 22 ++++++++ .../gcc.dg/tree-ssa/phi-opt-value-4.c | 36 +++++++++++++ gcc/testsuite/gcc.dg/tree-ssa/vrp03.c | 2 +- 10 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/cond-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-1a.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-value-4.c