#Prevent inline
8 messages · Page 1 of 1 (latest)
Does Mojo inline functions by default? The Mojo compiler has always been taunted as simple because it doesn't do all this compiler magic unless you explicitly tell it to.
One of the mayor selling point (for me) is that Mojo does the most imaginable optimizations currently available. compiling C++ to MLIR and lowering all the way back to assembly is neat, but the first step C++ to MLIR will loose many intentions a C++ programmer may have had. Mojo is (for me) a nice MLIR syntax. As a result the "compiler magic" is maximal.
That also means that almost everything get inlined... which may not be what you need when debugging stuff...
Yes, mojo does .
Normally the compiler will do this automatically where it improves performance, but this decorator forces it to occur, the downside is that it can increase the binary size for the duplicated functions
https://mojodojo.dev/guides/decorators/always_inline.html
Learning Resources for Mojo 🔥
I see. Basically we need a decorator that says "don't inline".
you can add -0O (that’s a zero then a capital O) to mojo build to prevent inlining
stands for zero optimizations