Looking to upgrade my audio setup with a Blue Yeti USB microphone! If you'd like to support the channel, you can buy me a coffee here: ko-fi.com/thecodinggopher.
@debbie80624 күн бұрын
very well made! your vids are getting better after each post, keep it up :)
@TheCodingGopher4 күн бұрын
🚀!
@architmishra0153 күн бұрын
Damn! That was such an easy explanation of the underlying working of clang. Would love to see one on LLVM itself. How it converts the code to IR and then machine executable and how can we make our own compiler using it
@TheCodingGopher3 күн бұрын
Thanks for watching! I made a video called `What is LLVM: How It Powers Modern Compilers and Optimizes Code`. It covers all the fundamentals of LLVM
@playea1233 күн бұрын
All hail Chris Lattner
@TheCodingGopher3 күн бұрын
A true legend
@josephliu8802Күн бұрын
@TheCodingGopher Are all Clang optimizations mentioned here available in GCC?
@TheCodingGopher23 сағат бұрын
Not all optimizations available in Clang have a direct equivalent in GCC, but the core optimizations (i.e. the -O1, -O2, -O3 optimizations in the video) are shared between both compilers
@Kiyuja3 күн бұрын
maybe this is outdated info but isnt O3 known to cause unstable code? AFAIK only O1 (size) and O2 (speed) are regarded as "safe" optimization flags
@TheCodingGopher3 күн бұрын
I'd say what sets -O3 apart is its aggressive speculative optimizations. -O3 tends to assume well-defined behavior and may reorder / remove code based on these assumptions (i.e. introducing instability, especially in edge cases like undefined behavior / infinite loops). Definitely use -O1 or -O2 if you want to prioritize safety
@debbie80623 күн бұрын
Could you clarify or share recent examples of situations where -O3 optimization might cause instability?
@Kiyuja5 сағат бұрын
@@debbie8062 I can infact not, as I never used O3 myself. I do however have friends that told me and it also came up again in recent years when the Mario 64 decomp landed and people found out "oh no the US and JP Rom use -g flag, only the Pal version uses O2" . Now why didnt they use O3? Because its famous for doing risky stuff that can impact stability (funfact on the N64 O1 would've been much better since the console is so horribly bandwidth limited)
@Kiyuja5 сағат бұрын
@@TheCodingGopher yeah thats what I've been told as well. I wonder whether Rust's forced expressiveness can reduce this as you are basically forced to tell the compiler exactly what you want, therefore the compiler might be able to make better assumptions.