Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Kragen Javier Sitaker Newsgroups: comp.lang.forth Subject: Re: First result in riscv optimiser Date: Fri, 04 Sep 2026 13:14:43 -0300 Organization: Primarily biological and memetic Lines: 18 Message-ID: <87ecf96ljg.fsf@debian> References: <2026Sep1.173341@mips.complang.tuwien.ac.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 04 Sep 2026 16:14:47 +0000 (UTC) Injection-Info: dont-email.me; logging-data="839551"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX187lmfRWcTsmxejyhxsa2P0"; posting-host="19f430bbdbc28c507341c3e22c7199b5" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) Cancel-Lock: sha1:WbCEGqhIbdpVzLQp7/84R/btl5w= sha1:Mss2FUD6lBZJcirJJhlwvPjeFM8= sha256:PNIX7Q0DCjtq6cRDW2EFQs1Ij1QMVHHgrl3Hg04j3O0= sha1:ApbzPa+DBwKZzDK6mm3EFNpa/vE= sha256:GfWhCxF8XWvq/3cetJTz5iOY11RjGH2aA/o0fGgYzmI= Xref: csiph.com comp.lang.forth:135556 anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: > (...) in general I don't think that full constant folding will trigger > often, but partial constant folding (e.g., optimizing "5 -" into lit+ > with the immediate argument -5) is probably relatively frequent, and > occasionally, constant folding works in cases where a much > heavier-weight optimization would otherwise be needed. This is contextual. I have no doubt that you are correct in the case of GForth, but in some compilers, constant folding is one of the most important and frequently used optimizations. But that’s because they’re doing inlining and/or specialization, which create lots more constants to fold, and dead-code elimination, which prunes conditionals that are resolved at compile time by constant folding. I don’t know enough about ciforth to guess how important it will be in the ciforth context. Kragen