From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jimmy Yuen Ho Wong Newsgroups: gmane.emacs.devel Subject: Re: How does nativecomp compile circular lists? Date: Wed, 28 Jul 2021 03:18:48 +0100 Message-ID: References: <875ywvdyrs.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007d3abf05c8259d7e" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32025"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs-Devel devel To: Michael Heerdegen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jul 28 04:20:14 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m8ZB5-0007zo-Fs for ged-emacs-devel@m.gmane-mx.org; Wed, 28 Jul 2021 04:20:11 +0200 Original-Received: from localhost ([::1]:41158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8ZB4-0001ra-E3 for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Jul 2021 22:20:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8ZAP-0001BM-2B for emacs-devel@gnu.org; Tue, 27 Jul 2021 22:19:29 -0400 Original-Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:43787) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m8ZAN-0001UE-FL for emacs-devel@gnu.org; Tue, 27 Jul 2021 22:19:28 -0400 Original-Received: by mail-lf1-x129.google.com with SMTP id f18so990363lfu.10 for ; Tue, 27 Jul 2021 19:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lNd0MDphiI+DvSk01PpoUUMEAJQ6s57OuB364K+ScDs=; b=TT+5nMoczmDolgB+FRZV2/FynvhLj42lDq8PJap/QvwIlsBuq5xkfKFHQfAVNG/ABy n6yIU2jVPV4h3XEWrhgtBlPlX0z8veVpj8spI+yXuMc+rdQPs2s/Ty5PLMTFO//tsjhE HYj5UtqKq1fODcqo1P3OkQC4o95kudeJvCkOnsn101bu7DwGBhFqoWfiiDpBtQhN3hOI jwGtDyTfpQDHa8MaMrl2xlIk3r4MokaY98jtKnfH6Q7SM3Jcy0/n/fyZVg7595+ZvWMg 275kn0Ct/RaegBC+ixwBaK8YQugLBqlu9JUztip1FFc8aywVBPmE7sJ7SLf8rmMdmZNQ BQlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lNd0MDphiI+DvSk01PpoUUMEAJQ6s57OuB364K+ScDs=; b=rTAouCB0IOOtAqtFvwR0Z+eOLyiQZurVzMXq4lvgcestM44lL37LVReqFa+Mi4xo9Q hDoNuTd4wHTKytZXb8VzFmwQHWVaTtEkQmuPlPPrz2mePEP8xKeTTrF/2CHOi7M1Si6i R+E1q5g9HQ5emtv3bYZH5SMkPciA/jDITDVW03V7yH7jWg1azxsEiBW5OTZY9REEPl7t q36JzgRYCyBlfzygXS0JPCzvzu+OCfDerkzIQf1qc23/gdUvk/02iVsFCX7XZc7AUind Mbt4A0PT7wB3HYriE9qpvnb+uEW41sGCHduuwmoubY5CRaIPAxXVcQaaaAT0ATQh4kWH /v2w== X-Gm-Message-State: AOAM5337cN5d+MTVhWnc7+coaKYtshVYVsEdt5wirL9eTXSqjrJBNyIU 74oZO/L+f+4vPr8ZSqcAlMJiNqiIShSFyQfUJcQ= X-Google-Smtp-Source: ABdhPJzozSBGYuxZjKSikbk2u0ZlaO82PT4uTfr6HH/F04UppblArgvorcrdmRV2W/1/2XImj/XV4KAepU1Fxe6j5Ac= X-Received: by 2002:ac2:5e9a:: with SMTP id b26mr19284880lfq.362.1627438765127; Tue, 27 Jul 2021 19:19:25 -0700 (PDT) In-Reply-To: <875ywvdyrs.fsf@web.de> Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=wyuenho@gmail.com; helo=mail-lf1-x129.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:271717 Archived-At: --0000000000007d3abf05c8259d7e Content-Type: text/plain; charset="UTF-8" That appears to be the case in elisp bytecode. What I'm trying to compare is how the GCC JIT deals with it. This simple test case I've taken out of powerline doesn't seem to produce different results between elisp and nativecomp tho, so the problem may have to do with how circular lists interact with something else, and how the JIT chooses to optimize it. I'm just trying to chase down these recurring issues that seem to emanate from circular lists. Jimmy On Wed, Jul 28, 2021 at 2:15 AM Michael Heerdegen wrote: > Jimmy Yuen Ho Wong writes: > > > (defun test-circular-list () > > (let ((l (list 1 2 3))) > > (setcdr (last l) l) > > l)) > > Does compiling that involve circular lists? The compiler doesn't call > the function, and there is no circular structure in that code...right? > > Michael. > > > --0000000000007d3abf05c8259d7e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That appears to be the case in elisp bytecode. What I'= m trying to compare is how the GCC JIT deals with it. This simple test case= I've taken out of powerline doesn't seem to produce different resu= lts between elisp and nativecomp tho, so the problem may have to do with ho= w circular lists interact with something else, and how the JIT chooses to o= ptimize it. I'm just trying to chase down these recurring issues that s= eem to emanate from circular lists.

Jimmy


On Wed, Jul 28, 2021 at 2:15 AM M= ichael Heerdegen <michael_he= erdegen@web.de> wrote:
Jimmy Yuen Ho Wong <wyuenho@gmail.com> writes:

> (defun test-circular-list ()
>=C2=A0 =C2=A0(let ((l (list 1 2 3)))
>=C2=A0 =C2=A0 =C2=A0(setcdr (last l) l)
>=C2=A0 =C2=A0 =C2=A0l))

Does compiling that involve circular lists?=C2=A0 The compiler doesn't = call
the function, and there is no circular structure in that code...right?

Michael.


--0000000000007d3abf05c8259d7e--