From patchwork Thu May 6 08:34:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1474864 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=fqB30ltB; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FbRhq4DpDz9sRf for ; Thu, 6 May 2021 18:34:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3A39D38618FF; Thu, 6 May 2021 08:34:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A39D38618FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1620290087; bh=L6k6tChDNJpmcaWUM0J3uy1V02aZNToa0wm0hBGM6tI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=fqB30ltBpFvsckWZbVkaji21Oq/o5+M34aXKwxVffpCVDW91TZrOUjf96XR2i4QL/ DuiI/ZW8DgPQ0Zz0xBV7xFSYn/np7xcHcRNHinU6FEzSmQeAmGlZsQ4S+YcmFVGfIY +D9/qFiFA+DQmvpMIaQf1CR2WjdH4jQZTUOcMD9E= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 7C09738618FF for ; Thu, 6 May 2021 08:34:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7C09738618FF Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-398-Srq_B_oUOe27qrG6oxJLjg-1; Thu, 06 May 2021 04:34:42 -0400 X-MC-Unique: Srq_B_oUOe27qrG6oxJLjg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 923DD1009E21; Thu, 6 May 2021 08:34:41 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-114-59.ams2.redhat.com [10.36.114.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 29C9E620DE; Thu, 6 May 2021 08:34:41 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 1468YcdC1459635 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 6 May 2021 10:34:38 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 1468YcIj1459634; Thu, 6 May 2021 10:34:38 +0200 Date: Thu, 6 May 2021 10:34:37 +0200 To: Richard Biener Subject: [PATCH] phiopt: Use gphi *phi instead of gimple *phi some more Message-ID: <20210506083437.GW1179226@tucnak> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi! Various functions in phiopt are also called with a gphi * but use gimple * argument for it. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2021-05-06 Jakub Jelinek * tree-ssa-phiopt.c (value_replacement, minmax_replacement, abs_replacement, xor_replacement, cond_removal_in_popcount_clz_ctz_pattern, replace_phi_edge_with_variable): Change type of phi argument from gimple * to gphi *. Jakub --- gcc/tree-ssa-phiopt.c.jj 2021-05-05 15:06:23.253189139 +0200 +++ gcc/tree-ssa-phiopt.c 2021-05-05 18:02:07.600019038 +0200 @@ -57,23 +57,23 @@ static bool conditional_replacement (bas static gphi *factor_out_conditional_conversion (edge, edge, gphi *, tree, tree, gimple *); static int value_replacement (basic_block, basic_block, - edge, edge, gimple *, tree, tree); + edge, edge, gphi *, tree, tree); static bool minmax_replacement (basic_block, basic_block, - edge, edge, gimple *, tree, tree); + edge, edge, gphi *, tree, tree); static bool abs_replacement (basic_block, basic_block, - edge, edge, gimple *, tree, tree); + edge, edge, gphi *, tree, tree); static bool xor_replacement (basic_block, basic_block, - edge, edge, gimple *, tree, tree); + edge, edge, gphi *, tree, tree); static bool spaceship_replacement (basic_block, basic_block, edge, edge, gphi *, tree, tree); static bool cond_removal_in_popcount_clz_ctz_pattern (basic_block, basic_block, - edge, edge, gimple *, + edge, edge, gphi *, tree, tree); static bool cond_store_replacement (basic_block, basic_block, edge, edge, hash_set *); static bool cond_if_else_store_replacement (basic_block, basic_block, basic_block); static hash_set * get_non_trapping (); -static void replace_phi_edge_with_variable (basic_block, edge, gimple *, tree); +static void replace_phi_edge_with_variable (basic_block, edge, gphi *, tree); static void hoist_adjacent_loads (basic_block, basic_block, basic_block, basic_block); static bool gate_hoist_loads (void); @@ -389,7 +389,7 @@ tree_ssa_phiopt_worker (bool do_store_el static void replace_phi_edge_with_variable (basic_block cond_block, - edge e, gimple *phi, tree new_tree) + edge e, gphi *phi, tree new_tree) { basic_block bb = gimple_bb (phi); basic_block block_to_remove; @@ -1113,8 +1113,7 @@ absorbing_element_p (tree_code code, tre static int value_replacement (basic_block cond_bb, basic_block middle_bb, - edge e0, edge e1, gimple *phi, - tree arg0, tree arg1) + edge e0, edge e1, gphi *phi, tree arg0, tree arg1) { gimple_stmt_iterator gsi; gimple *cond; @@ -1422,8 +1421,7 @@ value_replacement (basic_block cond_bb, static bool minmax_replacement (basic_block cond_bb, basic_block middle_bb, - edge e0, edge e1, gimple *phi, - tree arg0, tree arg1) + edge e0, edge e1, gphi *phi, tree arg0, tree arg1) { tree result; edge true_edge, false_edge; @@ -2266,7 +2264,7 @@ spaceship_replacement (basic_block cond_ static bool cond_removal_in_popcount_clz_ctz_pattern (basic_block cond_bb, basic_block middle_bb, - edge e1, edge e2, gimple *phi, + edge e1, edge e2, gphi *phi, tree arg0, tree arg1) { gimple *cond; @@ -2424,7 +2422,7 @@ cond_removal_in_popcount_clz_ctz_pattern static bool abs_replacement (basic_block cond_bb, basic_block middle_bb, edge e0 ATTRIBUTE_UNUSED, edge e1, - gimple *phi, tree arg0, tree arg1) + gphi *phi, tree arg0, tree arg1) { tree result; gassign *new_stmt; @@ -2548,7 +2546,7 @@ abs_replacement (basic_block cond_bb, ba static bool xor_replacement (basic_block cond_bb, basic_block middle_bb, edge e0 ATTRIBUTE_UNUSED, edge e1, - gimple *phi, tree arg0, tree arg1) + gphi *phi, tree arg0, tree arg1) { if (!INTEGRAL_TYPE_P (TREE_TYPE (arg1))) return false;