From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id A3E923858D28 for ; Tue, 23 Nov 2021 16:36:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3E923858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz 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-out1.suse.de (Postfix) with ESMTPS id 463BA2191A; Tue, 23 Nov 2021 16:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1637685371; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=33mU8lF1khSfGAoAb0aM4VKSoN8la5qlNORFQO7Xu9A=; b=hjL9IMM4ROiON35tu2rWuvQ1AmN1Rk7nOiFmKTf8pR7/DaO66s5NFi20uWUbRd8DmrlGlH jqRJkLCmWvVbX65YuMO0XO0IeRdL54fBCoDx1P7xAyvsNw7eT1jgjfIDQWSvBk9jrdDffS mDxnWOGHYw4wZDwnFE+Ggig6qA/iIoo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1637685371; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=33mU8lF1khSfGAoAb0aM4VKSoN8la5qlNORFQO7Xu9A=; b=W9talnSqohzq19QArfbvwXHf+ITuhSh6W86HTS+hcalDY66CgxqjNJpUslA6JjuqyHcpkE a67+xjfqsEq7ilBA== 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 340EB13E38; Tue, 23 Nov 2021 16:36:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id HZNmC3sYnWGyZwAAMHmgww (envelope-from ); Tue, 23 Nov 2021 16:36:11 +0000 Message-ID: <0db1d9e8-f097-e766-a9fa-1a98c47b8115@suse.cz> Date: Tue, 23 Nov 2021 17:36:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH] Loop unswitching: support gswitch statements. Content-Language: en-US From: =?UTF-8?Q?Martin_Li=c5=a1ka?= To: Richard Biener Cc: GCC Patches References: <7791e850-f74d-8c1c-f67c-e02f3f6e007d@redhat.com> <5c6c91d4-ed8b-8d98-2cd9-bafc84e6f2a4@suse.cz> <8da24825-19ec-56a6-a68c-5c37c7acc3e1@redhat.com> <59763e1a-8432-5f23-c399-a9b4dd6c6dff@suse.cz> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Tue, 23 Nov 2021 16:36:14 -0000 On 11/23/21 16:20, Martin Liška wrote: > Sure, so for e.g. case 1 ... 5 we would need to create a new unswitch_predicate > with 1 <= index && index <= 5 tree predicate (and the corresponding irange range). > Later once we unswitch on it, we should use a special unreachable_flag that will > be used for marking of dead edges (similarly how we fold gconds to boolean_{false/true}_node. > Does it make sense? I have thought about it more and it's not enough. What we really want is having a irange for *each edge* (2 for gconds and multiple for gswitchs). Once we select a unswitch_predicate, then we need to fold_range in true/false loop all these iranges. Doing that we can handle situations like: if (index < 1) do_something1 if (index > 2) do_something2 switch (index) case 1 ... 2: do_something; ... as seen the once we unswitch on 'index < 1' and 'index > 2', then the first case will be taken in the false_edge of 'index > 2' loop unswitching. Martin