From patchwork Tue Jun 11 13:53:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2" X-Patchwork-Id: 1946349 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=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=NF9w9VKo; 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 4Vz9Br3q49z20Py for ; Tue, 11 Jun 2024 23:54:12 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB870385DDD1 for ; Tue, 11 Jun 2024 13:54:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by sourceware.org (Postfix) with ESMTPS id 76BD1385DDE6 for ; Tue, 11 Jun 2024 13:53:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 76BD1385DDE6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 76BD1385DDE6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718114010; cv=none; b=kceY/zRgPtyByfQfXfDbMyZGWujy4TjDME7KuWxYIHeb0bdTTsC1hACR46Le8XWoa/lYNyDtI570zskvOXInVlDvuXmB6P0+W8ThW1s9sE5M8HN4onboJvVlOgDjkqfkh9r93s7P4vZsYixT1L8ldZr4m6XfCG9NccYXwuuIqq0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718114010; c=relaxed/simple; bh=Uq4eJ5qx35QA5X5Q+UbTL9uxoqJDNGnoKtXV5EQIpnc=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=c7ShxkxJFx7Bk/1j/00iawNaq+VY3x++w2gS05dvozIEUun5i2qLFIY0GDjqXelGFUDFFSYZpOwtUpJWnbav5Lu4gamm42wxQgn1tu3HA+ZqA+Vsp67mV39Jr6K1NN3WYJVQTMf9rJpza+uupVmhXvfn/fUaA/a9mICih1mYhP0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718114009; x=1749650009; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Uq4eJ5qx35QA5X5Q+UbTL9uxoqJDNGnoKtXV5EQIpnc=; b=NF9w9VKo9+elbSYXdS5EX1E8Zq0yk1e0F1YYtHC5qY/S3tzq0JBufvQw 0Sj9Ci+UtC7wa0ew6CBXfNMb9Ij8EmQnCs3V4C1YUMqXSh4ueB/d6mX/z Uurc9cSxQ8kH86poZVKqX9OoyDhgWsBDz5UHDgYUxcneNY8qpdoSIt7C9 /8tgVeaA46nKTzZjjmTmajGrbIVsurisumNUT06BiTkC2mQQ3Gxo+ksAu JYXbusffHvENDmqzYXwPxgltegZ7LEapfvdBPZacPUADeIF7ezuSL5UIN IDcD2DPZqhOeOJBJyKpJBxd/vSOXTVqd+akDDEwsx5cOTuhx7VGbRNtJm A==; X-CSE-ConnectionGUID: xFqS8NGpTie6AAx0qz1HHA== X-CSE-MsgGUID: WVxsltUhSNeJGAFrhlxuLA== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="14994195" X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="14994195" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 06:53:28 -0700 X-CSE-ConnectionGUID: rcKqkdr/QfKb8b946/1+ug== X-CSE-MsgGUID: Q2D2U6c8Toqi/ZZ6RKhy7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="44568658" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orviesa004.jf.intel.com with ESMTP; 11 Jun 2024 06:53:25 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 377E31007379; Tue, 11 Jun 2024 21:53:24 +0800 (CST) From: pan2.li@intel.com To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, kito.cheng@gmail.com, richard.guenther@gmail.com, jeffreyalaw@gmail.com, Pan Li Subject: [PATCH v1] Widening-Mul: Take gsi after_labels instead of start_bb for gcall insertion Date: Tue, 11 Jun 2024 21:53:22 +0800 Message-Id: <20240611135322.876470-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 From: Pan Li We inserted the gcall of .SAT_ADD before the gsi_start_bb for avoiding the ssa def after use ICE issue. Unfortunately, there will be the potential ICE when the first stmt is label. We cannot insert the gcall before the label. Thus, we take gsi_after_labels to locate the 'really' stmt that the gcall will insert before. The existing test cases pr115387-1.c and pr115387-2.c cover this change. The below test suites are passed for this patch. * The rv64gcv fully regression test with newlib. * The x86 regression test. * The x86 bootstrap test. gcc/ChangeLog: * tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children): Leverage gsi_after_labels instead of gsi_start_bb to skip the leading labels of bb. Signed-off-by: Pan Li --- gcc/tree-ssa-math-opts.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc index fbb8e0ea306..c09e9006443 100644 --- a/gcc/tree-ssa-math-opts.cc +++ b/gcc/tree-ssa-math-opts.cc @@ -6102,7 +6102,7 @@ math_opts_dom_walker::after_dom_children (basic_block bb) for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi); gsi_next (&psi)) { - gimple_stmt_iterator gsi = gsi_start_bb (bb); + gimple_stmt_iterator gsi = gsi_after_labels (bb); match_unsigned_saturation_add (&gsi, psi.phi ()); }