How does D cope with aliasing

bearophile bearophileHUGS at lycos.com
Sat Sep 5 10:06:06 PDT 2009


#ponce:
> I'm currently using a lot of pointers to perform heavy computation  Has D the equivalent for C's restrict ? More generally, how does D cope with the aliasing of pointers ? I think it's crucial for the code optimizer.<

DMD probably just doesn't perform such optimizations. LLVM that's under LDC is probably able to perform such optimizations, but in the language there is no way to give such semantics to the compiler.
My suggestion for you is to ask for such feature in the main D newsgroup, and/or in bugzilla. In the meantime you can also ask such feature to LDC developers, they may just add a small LDC-specific pragma that gives such semantics to the LLVM (in future, when D will add such annotation LDC developers will just change the syntax of this feature). (I'll ask to LDC developers to see what they think).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list