Talk about a perfect storm of fixes and enhancements! With the latest commit by Arch Robison, the native code is remarkably similar to clang's output — just load, test, and multiply and add. It's funny to read folks in the issue talking about how much faster the 0.3 version is… when the final result ended up being something like > 50 million fold faster than 0.2. So very impressive.
You should complain about strange LLVM code more often, Rak. Here's the native code now: julia> code_native(f, (Int,)) .section __TEXT,__text,regular,pure_instructions Filename: none Source line: 2 push RBP mov RBP, RSP movabs RAX, 140508429342280 Source line: 2 mov RAX, QWORD PTR [RAX] test RDI, RDI jle 7 Source line: 3 imul RDI, RDI add RAX, RDI Source line: 6 pop RBP ret On Wednesday, April 2, 2014 9:26:44 PM UTC-4, andrew cooke wrote: > > > thanks! it's just possible this will fix a performance issue of mine :o) > > On Wednesday, 2 April 2014 16:57:36 UTC-3, Steven G. Johnson wrote: >> >> Just filed this as an issue: >> https://github.com/JuliaLang/julia/issues/6382 >> >