Inlining problem of core.bitops

jkrempus at jkrempus at
Sat Dec 28 02:53:02 PST 2013

In LDC, core.bitop.bsf is just an ordinary function compiled in 
libdruntime-ldc.a. Since bitop.d isn't on the command line, LDC uses the 
precompiled code in the library, which can't be inlined. You can get it 
to inline bsf by putting bitop.d on the command line:

ldmd2 -O -release -inline -output-s test.d /opt/ldc/include/d/core/bitop.d

    movl	%edi, %eax
    bsfq	%rax, %rax

It inlines llvm_cttz because that is an llvm intrinsic.

More information about the digitalmars-d-ldc mailing list