Null check optimization

David Nadlinger via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Sun Dec 13 06:19:38 PST 2015


On 5 Dec 2015, at 0:33, deadalnix via digitalmars-d-ldc wrote:
> I was at the LLVM meetup yesterday and talked with a contributor that 
> use LLVM to run java code. One on the very interesting that came up is 
> a way to use segfault in order to do null cheks. It is explained here:
>
> http://llvm.org/docs/FaultMaps.html#make-implicit-metadata
>
> I know that ldc generate null checks when calling various functions. 
> It may be a good idea, considering this is unexpected, ot use the same 
> mechanism in LDC.

It's certainly an interesting approach. I supposed we would need to look 
into which checks actually make it to the hot patch of optimized builds, 
though, as the comparatively small performance gain probably wouldn't be 
worth it in debug builds.

  — David


More information about the digitalmars-d-ldc mailing list