From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 1556A3858436 for ; Fri, 20 Oct 2023 13:52:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1556A3858436 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1556A3858436 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:67c:2178:6::1d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697809940; cv=none; b=AwYdpm2oY2H85zNyo8JvhEZIlEz3ODkPHuh8olXB/dgSB6ru3UZpXr5xkgVdFZG+om5o6d2A0cEZBm8NuJItr5QazFE7fHmyKUDLTnknakEuWTyGVOncYvPscOJca0EOJQQYN8OTUKeJ6tIso1EYKYXj0IhGYuOZFFv0fLyQTFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697809940; c=relaxed/simple; bh=PBe/lFi51UN1zIMNfwJnIGB4BtatqJLKtHXgcB/rKu8=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=vmzwF4lQPNWb3NKZghGsoDfAOqQFV7wr18/+QQgBm7pGSiAE7QQaB0qItR825M58gACSerGXcWw0icdx6FDgfnagy90cDsLHfuO/6Q9SLrk+vE0VI0yARsSmPcfOvkOcz9kTN859h8gITra3jMumvmoQfG6aaPVMuDyEx38+79c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id E602D1F86B for ; Fri, 20 Oct 2023 13:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1697809933; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/87EsDPOhnEG8UyGU399jUffvOqLBF8f8jJfST1XbaI=; b=yUv+VQkL3xQbs7uYF+4T/vTG1ja0Fz45NRMJrUVAVBWzHZuRflL0K28QeB+iTrJDmxvlN2 cutYr3DJAZVS46Jpr2aHE+/NikGBuBWjh6UykmU3olQPcp28xFhaWVmspS0JbClsTfku/s BT3hEcnY1oBmRH7nX45g1g51Jhtr3zc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1697809933; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/87EsDPOhnEG8UyGU399jUffvOqLBF8f8jJfST1XbaI=; b=bsaie/VkCdf+XaLvseYX64JdhU1eiQVeRJ0Z+ITEC6V8CEz4LHYD4JD7q4TcwLt5qymdxW gK+NaXcq4l2WguDQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DA71013584 for ; Fri, 20 Oct 2023 13:52:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hOtKNQ2GMmVZMgAAMHmgww (envelope-from ) for ; Fri, 20 Oct 2023 13:52:13 +0000 Date: Fri, 20 Oct 2023 15:52:13 +0200 From: Filip Kastl To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] A new copy propagation and PHI elimination pass Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -7.08 X-Spamd-Result: default: False [-7.08 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-3.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gcc-patches@gcc.gnu.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.98)[99.89%] X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_SOFTFAIL,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri 2023-10-20 15:50:25, Filip Kastl wrote: > Bootstraped and tested* on x86_64-pc-linux-gnu. > > * One testcase (pr79691.c) did regress. However that is because the test is > dependent on a certain variable not being copy propagated. I will go into more > detail about this in a reply to this mail. This testcase checks for the string '= 9' being present in the tree-optimized gimple dump ({ dg-final { scan-tree-dump " = 9;" "optimized" } }). This is how the relevant place in the dump looks like without my patch: int f4 (int i) { int _6; [local count: 1073741824]: _6 = 9; return _6; } Note that '= 9' is indeed present but there is an opportunity for copy propagation. With my patch, the copy propagation happens: int f4 (int i) { int _6; [local count: 1073741824]: return 9; } Which means no '= 9' is present and therefore the test fails. What should I do? I don't suppose that changing the testcase to search for just '9' would be wise since the dump may contain other '9's. I could change it to search for 'return 9'. That would make it dependent on some copy propagation being run late enough. However it is currently dependent on *no* copy propagation being run late in the compilation. Also, if the test would search for 'return 9', it would search for the most optimized version of the function f4. Or maybe searching for '9;' would work. Filip Kastl