__assume

via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Fri Feb 20 01:33:55 PST 2015


Commercial compilers provide a way to tell the compiler 
invariants that are known to always hold, e.g. MSVC provides 
__assume(x). LLVM eliminates such assumptions prematurely 
according to this link:

https://github.com/preames/llvm-assume-hack

Does this also affect:

http://llvm.org/docs/LangRef.html#llvm-assume-intrinsic

?

Does LDC provide some means for providing assumptions to the 
compiler, for library authors? One use case is to provide 
assumptions about alignment of void pointers and similar 
constrains that are known to hold for library ADTs.


More information about the digitalmars-d-ldc mailing list