From patchwork Thu Oct 24 14:37:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Melcr X-Patchwork-Id: 99503 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 71273385840C for ; Thu, 24 Oct 2024 16:33:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from pjepjeno-arch.localdomain (unknown [147.32.96.50]) by sourceware.org (Postfix) with ESMTP id 588803858D21 for ; Thu, 24 Oct 2024 16:32:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 588803858D21 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=fit.cvut.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=pjepjeno-arch.localdomain ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 588803858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=147.32.96.50 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729787551; cv=none; b=GSSyZIfBt6wZ6IYdLqd3qYOWQd9WB6i7+naox+e6sBwqJKaFDwHTjpbhuGtl16wtu538G+l4Zq7L3kp0YI41+tE0XtmkUdLpw9G0ivI9cp04lpjc7qBtkBz9k9sWiaYWmRK4gg2rM6tQ4dIyMjYNbxOu3g5bo+eSswIayQQTOkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729787551; c=relaxed/simple; bh=PwkGKJkReUk7BNY+59uplnM0paDPi3blq1erTmAzAA8=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=W7MDrmESsUvAj/iGOfxJeMHgMb4MECmgOha28xo8OQiT+psq0o/zx2690vjfjb7EW/kx0CbBl6Soz+nwsKJJgW0gfuf3Q+WHPGDZkTAzf/35qgY3WcgnftaJub7lnxtf4pcK7s+UgbkCRXX3NL0SikwNOxGrCcK4ozPqsAbcKHg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by pjepjeno-arch.localdomain (Postfix, from userid 1000) id 79B7C20003F; Thu, 24 Oct 2024 16:37:39 +0200 (CEST) From: Josef Melcr To: gcc-patches@gcc.gnu.org Cc: Josef Melcr Subject: [PATCH] cgraph: remove dead if stmt in build_cgraph_edges pass Date: Thu, 24 Oct 2024 16:37:24 +0200 Message-ID: <20241024143724.3790409-1-melcrjos@fit.cvut.cz> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, NO_DNS_FOR_FROM, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, 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~patchwork=sourceware.org@gcc.gnu.org This patch removes a dead if statement checking for gomp-parallel gimple statements. This if is in the execute method of build_cgraph_edges pass, which is executed right after the omp_expand pass, which removes these gimple statements and replaces them with simple gcalls, making this if practically dead. Some TSan tests are failing with this patch, but I don't think this change is likely to cause these failures. Additionally, the failures are not consistent across runs, making me think these failures are a bug in TSan itself. All other tests are ok. Tested on x86_64-pc-linux-gnu. OK for master ? gcc/ChangeLog: * cgraphbuild.cc (pass_build_cgraph_edges::execute): remove if statement checking for gomp-parallel statements Signed-off-by: Josef Melcr --- gcc/cgraphbuild.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/gcc/cgraphbuild.cc b/gcc/cgraphbuild.cc index 8852ba9ee92..191ec1077e4 100644 --- a/gcc/cgraphbuild.cc +++ b/gcc/cgraphbuild.cc @@ -340,12 +340,6 @@ pass_build_cgraph_edges::execute (function *fun) bb->count); } node->record_stmt_references (stmt); - if (gomp_parallel *omp_par_stmt = dyn_cast (stmt)) - { - tree fn = gimple_omp_parallel_child_fn (omp_par_stmt); - node->create_reference (cgraph_node::get_create (fn), - IPA_REF_ADDR, stmt); - } if (gimple_code (stmt) == GIMPLE_OMP_TASK) { tree fn = gimple_omp_task_child_fn (stmt);