From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 7F11E3858C53 for ; Fri, 1 Mar 2024 09:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7F11E3858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7F11E3858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709286395; cv=none; b=Xy9GdJKaAS9PhcF/eVF17VGnw5YYyZvoxG6Ie5Dcv37/jGBX0HI90KSPpBKfL+Ka+nClPgBqBUTSRo6y1dEH8Gjdq0FpoLurv+TPTjOXGh1Mh81J/auBud57VJLc1qpvUllaPkADZzCCcUUPg8bQmBGdb2odRJyzoSrU/PfwgHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709286395; c=relaxed/simple; bh=yPvMfRT9Q49qDTIFX5GXuAWzBGOlrlx796V02J0mfDs=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=gS0dSd1fs0msxMdCON55TURWYCNs9EC4g646QqeCEfUaOC1/BbgmWWoEhAc9vHq9qwi9fz3dqIwi6Aj+EhTWe5DJEoZsEOLnFnXezq/6+C1tjYBnI/i2inQCvXv8gaYTrPznqD9bcID2mWNcuQxql9nU7lTcr8m1v92h3SM5Q/k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.168.4.150] (unknown [10.168.4.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 634AA2007D; Fri, 1 Mar 2024 09:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709286389; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=seHuhXw7BLec4rfUKhl2Jrz71Ryh3KnEbpsL0ltnxxA=; b=JXI5wf8tyD210kGM3a5QrhhTatKlaD31L9w8gKTt4mrzlBWpyXOXtLKCcuVeBX2zE9iMQr u6rrxTr35DPFITrNig+MdyojkXkldsZ38pH7S/oJ3DQukK8GwtXWamuXIo5EYN62NpB13j QPuaqF6RfREYYX/ySDT3dU59VhVLHm8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709286389; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=seHuhXw7BLec4rfUKhl2Jrz71Ryh3KnEbpsL0ltnxxA=; b=jAVYTrbotg3to8347IotrVxgvv0eo0dpAR4W6rfVfYvua5U76LfzrAgrpkASB+tHxALWGZ V2UQY06vJ0MCCxAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709286389; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=seHuhXw7BLec4rfUKhl2Jrz71Ryh3KnEbpsL0ltnxxA=; b=JXI5wf8tyD210kGM3a5QrhhTatKlaD31L9w8gKTt4mrzlBWpyXOXtLKCcuVeBX2zE9iMQr u6rrxTr35DPFITrNig+MdyojkXkldsZ38pH7S/oJ3DQukK8GwtXWamuXIo5EYN62NpB13j QPuaqF6RfREYYX/ySDT3dU59VhVLHm8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709286389; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=seHuhXw7BLec4rfUKhl2Jrz71Ryh3KnEbpsL0ltnxxA=; b=jAVYTrbotg3to8347IotrVxgvv0eo0dpAR4W6rfVfYvua5U76LfzrAgrpkASB+tHxALWGZ V2UQY06vJ0MCCxAw== Date: Fri, 1 Mar 2024 10:46:29 +0100 (CET) From: Richard Biener To: Jakub Jelinek cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] bitint: Handle VCE from large/huge _BitInt SSA_NAME from load [PR114156] In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -1.14 X-Spamd-Result: default: False [-1.14 / 50.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(2.96)[0.987]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,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 List-Id: On Fri, 1 Mar 2024, Jakub Jelinek wrote: > Hi! > > When adding checks in which case not to merge a VIEW_CONVERT_EXPR from > large/huge _BitInt to vector/complex etc., I missed the case of loads. > Those are handled differently later. > Anyway, I think the load case is something we can handle just fine, > so the following patch does that instead of preventing the merging > gimple_lower_bitint; we'd then copy from memory to memory and and do the > vce only on the second one, it is just better to vce the first one. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK. Richard. > 2024-03-01 Jakub Jelinek > > PR middle-end/114156 > * gimple-lower-bitint.cc (bitint_large_huge::lower_stmt): Allow > rhs1 of a VCE to have no underlying variable if it is a load and > handle that case. > > * gcc.dg/bitint-96.c: New test. > > --- gcc/gimple-lower-bitint.cc.jj 2024-02-24 12:44:27.993108306 +0100 > +++ gcc/gimple-lower-bitint.cc 2024-02-29 19:28:59.442020619 +0100 > @@ -5329,6 +5329,22 @@ bitint_large_huge::lower_stmt (gimple *s > gimple_assign_set_rhs1 (stmt, rhs1); > gimple_assign_set_rhs_code (stmt, SSA_NAME); > } > + else if (m_names == NULL > + || !bitmap_bit_p (m_names, SSA_NAME_VERSION (rhs1))) > + { > + gimple *g = SSA_NAME_DEF_STMT (rhs1); > + gcc_assert (gimple_assign_load_p (g)); > + tree mem = gimple_assign_rhs1 (g); > + tree ltype = TREE_TYPE (lhs); > + addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (mem)); > + if (as != TYPE_ADDR_SPACE (ltype)) > + ltype > + = build_qualified_type (ltype, > + TYPE_QUALS (ltype) > + | ENCODE_QUAL_ADDR_SPACE (as)); > + rhs1 = build1 (VIEW_CONVERT_EXPR, ltype, mem); > + gimple_assign_set_rhs1 (stmt, rhs1); > + } > else > { > int part = var_to_partition (m_map, rhs1); > --- gcc/testsuite/gcc.dg/bitint-96.c.jj 2024-02-29 19:37:27.441032088 +0100 > +++ gcc/testsuite/gcc.dg/bitint-96.c 2024-02-29 19:36:34.815753879 +0100 > @@ -0,0 +1,17 @@ > +/* PR middle-end/114156 */ > +/* { dg-do compile { target bitint } } */ > +/* { dg-options "-O2" } */ > +/* { dg-additional-options "-msse2" { target i?86-*-* x86_64-*-* } } */ > + > +#if __BITINT_MAXWIDTH__ >= 128 > +_BitInt(128) a, b; > +#else > +int a, b; > +#endif > + > +void > +foo (void) > +{ > + int u = b; > + __builtin_memmove (&a, &b, sizeof (a)); > +} > > Jakub > > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)