From patchwork Sat Jan 27 07:57:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 192986 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2395:b0:106:343:edcb with SMTP id gw21csp373644dyb; Sat, 27 Jan 2024 00:15:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/KZt8vi2YqOTCGnJ85AJtkMucO9s9srdJsqco0Q3uezQcE41Ss/PYGO6X+8jxcamGIVNT X-Received: by 2002:a05:620a:909:b0:783:e065:d434 with SMTP id v9-20020a05620a090900b00783e065d434mr1206439qkv.29.1706343322099; Sat, 27 Jan 2024 00:15:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706343322; cv=pass; d=google.com; s=arc-20160816; b=pvIrW7eYqEVW8HfFbnJal7dsj4aIMmlOGCxxh7SZwIyuvTkDwvzEuwf8bgM2kr/wsX XxkKnMwZBNte8QDS5TiqdBOHG0QGsIG6wfLj+gNlZ96O4yMyZYp210v87qcUsge+TUkf s90ghTcWgqFewpTOc3N7t38CUVExSVSv7OxUluGT3flskdt1x8Yxy6MM2haNQdI3IvAF nFEKH/EZ9UB4BIPgRxwl2JHqPSK7C0QAsEEGDZzEyAR40AFyrGauEpJy7A9B2CYhIaW9 FRgiDNpuq2NkIGfh07dIDvhYlFczl3qIrxp80MilfZ9PXAvfzybDBMkgdou4jK2tIXnt E+4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:resent-to :resent-message-id:resent-date:resent-from:dkim-signature:arc-filter :dmarc-filter:delivered-to; bh=DaWOMtmBlFm87nBE6r3LcXXeYNMohky5/2OQjdDoAuI=; fh=FCjeRajqaQYHMkQtfIia8KT5yBac53mYOLLyJhYG/AY=; b=flV9M46Qz1zLO6h9YmRqI8Yn+SoLnA4H0PQm3Nps2G4wzebtPz732U3YDsyLZK8pOg Mz0VObqLL+P2YNrGEL1VO6pstiJJqmbZkQXSR09CNizez4R9za0CXB3YhZc3DRYwj6nd 6Dozk+ZwwIwgkLrXCZhMgVLkFiO0vXR1yokBRWc0rryGijZYIpJskJEB3uXGNqDabn8W ZrT6dueo2N8siH59n3jZl/YFVs9D4Y7Sg3fvIdd24NlLjDF0n0o97Ewht7CzZ+v01uWX /VNcq77M2Py9dQN0+8bQVtR5EL/dSm1aLWY8kEXnAcWW3xoGZk9pBUZj+m2oURRvIbm2 HMKw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jBiru9rs; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id q8-20020a05620a0d8800b00783aa61af29si3283540qkl.526.2024.01.27.00.15.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Jan 2024 00:15:22 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jBiru9rs; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B10613858296 for ; Sat, 27 Jan 2024 08:15:21 +0000 (GMT) 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 ESMTPS id 1ADF9385842F for ; Sat, 27 Jan 2024 08:13:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1ADF9385842F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1ADF9385842F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706343240; cv=none; b=yELlDHInXNlwt/AZzqm9a6jHJyT+qtoLrekoRQgq//q+2avvltplV1sRyuxXnW2uYB8VSbxc8uaW1eSe1bkgbE93iWHnoU8w9mzQ+9Yv7twKBm4kBOH/KUTfxJ17ODzuUxQAUCuDJnmLxNtyir49T7VScmKfbYpNke6fH5KefTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706343240; c=relaxed/simple; bh=kXNzyfUjnTkgLWn1YD+LsUO/mxHDwWNg0Ivn58c/3W0=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=cvGexPXdGwF2LiUmcXd2Dg4v2V3Y8j90eN8/+v921Sw0IS19jm8sfidF+iP6yDyr/7pDS16RKTMKhE/NQu5j6nAkMLQz6vs1Xx2Dxzenv64xf6I8FtbEEZeoCRRRNqw4mGrElknZakdOYrL5s6pTlQE2m70sNTJ/pnf3vyY5vVA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706343234; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-message-id; bh=DaWOMtmBlFm87nBE6r3LcXXeYNMohky5/2OQjdDoAuI=; b=jBiru9rsgazyhDkEtiPdU9vBYfZxnanb+D22Y22FmVZ5M9k1HQhaKxdkWV7KaOnhUsSIAK ehwowEQuN3M8hx49JGeY8peARCxPC6M9554PpR1q/y+I88VBgfkXdBfxrwJtkJdSFoXYKG hizgHUX4CyXia7aY/3yBKCs0Q+eMLVM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-510-r-PTg2XtM9KxmsQuIH9jYg-1; Sat, 27 Jan 2024 03:13:51 -0500 X-MC-Unique: r-PTg2XtM9KxmsQuIH9jYg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E42B928AC1EB; Sat, 27 Jan 2024 08:13:50 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9C1AC15995; Sat, 27 Jan 2024 08:13:50 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 40R8DmKf141159 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Sat, 27 Jan 2024 09:13:48 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 40R8DlAM141158; Sat, 27 Jan 2024 09:13:47 +0100 Resent-From: Jakub Jelinek Resent-Date: Sat, 27 Jan 2024 09:13:47 +0100 Resent-Message-ID: Resent-To: Richard Biener , gcc-patches@gcc.gnu.org Date: Sat, 27 Jan 2024 08:57:06 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] lower-bitint: Add debugging dump of SSA_NAME -> decl mappings Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789230655041765282 X-GMAIL-MSGID: 1789230655041765282 Hi! While the SSA coalescing performed by lower bitint prints some information if -fdump-tree-bitintlower-details, it is really hard to read and doesn't contain the most important information which one looks for when debugging bitint lowering issues, namely what VAR_DECLs (or PARM_DECLs/RESULT_DECLs) each SSA_NAME in large_huge.m_names bitmap maps to. So, the following patch adds dumping of that, so that we know that say _3 -> bitint.3 _8 -> bitint.7 _16 -> bitint.7 etc. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2024-01-27 Jakub Jelinek * gimple-lower-bitint.cc (gimple_lower_bitint): For TDF_DETAILS dump mapping of SSA_NAMEs to decls. Jakub --- gcc/gimple-lower-bitint.cc.jj 2024-01-26 00:07:35.629797857 +0100 +++ gcc/gimple-lower-bitint.cc 2024-01-26 17:40:29.083814064 +0100 @@ -6344,22 +6344,33 @@ gimple_lower_bitint (void) } } tree atype = NULL_TREE; + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "Mapping SSA_NAMEs to decls:\n"); EXECUTE_IF_SET_IN_BITMAP (large_huge.m_names, 0, i, bi) { tree s = ssa_name (i); int p = var_to_partition (large_huge.m_map, s); - if (large_huge.m_vars[p] != NULL_TREE) - continue; - if (atype == NULL_TREE - || !tree_int_cst_equal (TYPE_SIZE (atype), - TYPE_SIZE (TREE_TYPE (s)))) + if (large_huge.m_vars[p] == NULL_TREE) { - unsigned HOST_WIDE_INT nelts - = tree_to_uhwi (TYPE_SIZE (TREE_TYPE (s))) / limb_prec; - atype = build_array_type_nelts (large_huge.m_limb_type, nelts); + if (atype == NULL_TREE + || !tree_int_cst_equal (TYPE_SIZE (atype), + TYPE_SIZE (TREE_TYPE (s)))) + { + unsigned HOST_WIDE_INT nelts + = tree_to_uhwi (TYPE_SIZE (TREE_TYPE (s))) / limb_prec; + atype = build_array_type_nelts (large_huge.m_limb_type, + nelts); + } + large_huge.m_vars[p] = create_tmp_var (atype, "bitint"); + mark_addressable (large_huge.m_vars[p]); + } + if (dump_file && (dump_flags & TDF_DETAILS)) + { + print_generic_expr (dump_file, s, TDF_SLIM); + fprintf (dump_file, " -> "); + print_generic_expr (dump_file, large_huge.m_vars[p], TDF_SLIM); + fprintf (dump_file, "\n"); } - large_huge.m_vars[p] = create_tmp_var (atype, "bitint"); - mark_addressable (large_huge.m_vars[p]); } }