Matt Godbolt's blog attempts to outsmart the optimizer but ends up as an emoji-heavy reminder that some things are just unfooled by human cleverness. 🤓🎩📉 Apparently, even the compiler is rolling its eyes at our futile antics, generating "obvious code" as if to say, "Nice try, buddy." 🙄💻
https://xania.org/202512/03-more-adding-integers #MattGodbolt #CompilerOptimization #EmojiHumor #HumanCleverness #CodingFails #HackerNews #ngated
You can't fool the optimiser — Matt Godbolt’s blog

Pattern recognition can see through obfuscated code to find the right instruction

You’ve probably seen `use function strlen` in PHP and shrugged.

But here’s the twist: in certain cases, it activates a special compiler optimization in PHP that makes some functions significantly faster.

This is your eureka moment! Here’s how it works, when it matters, and how to adopt it easily: https://tideways.com/profiler/blog/compiler-optimized-php-functions?utm_medium=social&utm_source=mastodon&utm_campaign=compiler-optimized-php-functions

#php #opcache #compileroptimization #phptips #webdev #coding #programming #performance

Excited to learn about how KDAB's Shivam Kunwar is tackling the challenge of mapping LLVM values to source-level expressions at #FOSDEM 2024. Discover how this project using #LLVM intrinsic functions can revolutionize code optimization and memory access Thank you, @fosdem! More info: https://fosdem.org/2024/schedule/event/fosdem-2024-1682-map-llvm-values-to-corresponding-source-level-expressions/ #CompilerOptimization #CodeOptimization #MemoryAccess
FOSDEM 2024 - Map LLVM values to corresponding source-level expressions

Did you know that for natural numbers:

{x: >= 0, y = 2ⁿ}

the follow holds true:

x mod y

is equal to

x & (y - 1)

Example:

31882511 mod 1024

is equal to

31882511 & 1023

(where `mod` is the modulo operation and `&` is bitwise-and)

#Math #Algorithms #Programming #CompilerOptimization #Performance #Optimization

CLHS: Macro DEFINE-COMPILER-MACRO