Another fascinating article by Matt #Godbolt in his Advent of Compiler Optimization series. This one is about induction variables and loops:

https://xania.org/202512/09-induction-variables

Here, Matt uses the llvm-mca tool to visualize the x86 Haswell CPU pipeline to show loop-carried dependencies.

If you want to see this for RISC-V (SiFive U74) for one of the given examples, try this link (llvm-mca -march=riscv64 -mcpu=sifive-u74 -timeline):

https://aoco.compiler-explorer.com/z/9srhEGhsG

#compilers #optimization #risc_v #aoco2025

Induction variables and loops — Matt Godbolt’s blog

Compilers can rewrite loops to avoid expensive calculations

I can't use godbolt.org to confirm if the bug is still present in newer versions of GCC because I can't figure out how to see the `.ci` output file on godbolt.org. (Also, there's no "none-eabi" on godbolt.org, just "unknown-eabi" and "linux-gnueabihf"; the code won't compile with the GNU eabi, but I suspect that unknown-eabi will show the same behavior as none-eabi.)

#GCC #Godbolt

Literally README says "Do not use me, i am a piece of shit that will not work everywhere", but they keeps using it, especialy #gitea and #godbolt
No, when i am on desktop, i will use qtcreator to edit code, not browser, so it is COMPLETELY STUPID

You don't realize just how good C++23 is until you take some old C++ code, paste it into #Godbolt, set the compiler flags to C++23, add a few concept-checking asserts, read the beautifully clear error messages from concepts, and fix your problem.

#ModernCPP #CPP #Concepts #Legacy #Evolution #Happyiness #Programming

Matt #Godbolt bravely tackles the monumental challenge of creating #URLs that last forever—because we all desperately need browser tabs from 2012 🌐🔗. Turns out, cramming an entire compiler state into a URL just might not be the pinnacle of efficiency 🧐. But fear not, Google has come to the rescue, because who doesn't love outsourcing their problems to the tech overlords? 👾
https://xania.org/202505/compiler-explorer-urls-forever #Matt #CompilerState #BrowserTabs #TechOverlords #HackerNews #ngated
Compiler Explorer and the Promise of URLs That Last Forever — Matt Godbolt’s blog

How we're preserving 12,000 legacy links as Google's URL shortener rides into the sunset

[Перевод] Ускоряем работу видеодекодера на 1%

Какое-то время назад memorysafety.org объявил о конкурсе по повышению производительности rav1d — порта AV1-декодера dav1d на Rust. Моя фамилия Равид, совсем как название декодера, поэтому я решил, что будет забавно попробовать (хоть я и, вероятно , не смогу участвовать в конкурсе). Эта статья посвящена двум найденным мной небольшим улучшениям производительности ( первый PR , второй PR ) и рассказу о том, как я их нашёл.

https://habr.com/ru/articles/912136/

#оптимизация_кода #обработка_видео #декодер #dav1d #rav1d #godbolt

Ускоряем работу видеодекодера на 1%

Какое-то время назад memorysafety.org объявил о конкурсе по повышению производительности rav1d — порта AV1-декодера dav1d на Rust. Моя фамилия Равид, совсем как название декодера, поэтому я решил, что...

Хабр

Very interesting (and informing) video about x86_64 versus ARM architectures:

https://www.youtube.com/watch?v=Zr09I5OlOjs

#CPU #ARM #Intel #x86_64 #GodBolt

The Magic Of ARM w/ Casey Muratori

Recorded live on twitch, GET IN ### GuestCasey Muratori | https://x.com/cmuratori?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor### My Streamhttps://...

YouTube

Need a clue pls. What's the trick to get #godbolt to target RISC-V for Rust? Just adding the `--target riscv32i-unknown-none-elf` compiler flag didn't work:
https://godbolt.org/z/1df9GqEPW

Clearly there's a way as https://rust.godbolt.org/noscript/z/Y8s3Kf (with the appropriated corrections) works.
#UICouldBeBetter

Compiler Explorer - Rust (rustc nightly)

// Type your code here, or load an example. // As of Rust 1.75, small functions are automatically // marked as `#[inline]` so they will not show up in // the output when compiling with optimisations. Use // `#[no_mangle]` or `#[inline(never)]` to work around // this issue. // See https://github.com/compiler-explorer/compiler-explorer/issues/5939 #[no_mangle] pub fn square(num: i32) -> i32 { num * num } // If you use `main()`, declare it as `pub` to see it in the output: // pub fn main() { ... }

Does anybody know how to prevent #clang from issuing calls to libc functions like `memset` in this case when compiling C programs? I have tried I don't know how many command line arguments to try to disable it but none worked at all.

Here you have an example program in #godbolt: https://godbolt.org/z/jheYoPWzj

These are the command line arguments I've tried to disable it:

-ffreestanding -disable-simplify-libcalls -fno-builtin -nostdinc -nostdlib -fno-builtin-memset -nostdlib++ -nostdinc++

Any idea?

Compiler Explorer - C (armv7-a clang 16.0.0)

typedef unsigned long long size_t; extern void do_stuff(unsigned char *, size_t); int main() { { const size_t stuff_len = 65; unsigned char stuff[stuff_len] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; do_stuff(stuff, stuff_len); } }

Couple years ago it was good and very useful tool.
Now it is glitchy sh#t...
Scripts only became working after es2022 smoothie re syntax was added to browser, after weakref (which MDN says avoid to use) was polyfilled...
And... it still cannot render correctly. What was improved in frontend in last 2 years??? It seems, nothing...
#frontend #front #godbolt #ce #compilerexplorer #js #libraries