Thread overview | |||||
---|---|---|---|---|---|
|
December 04, 2015 Null check optimization | ||||
---|---|---|---|---|
| ||||
Hi all, 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. |
December 13, 2015 Re: Null check optimization | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On Friday, 4 December 2015 at 23:33:01 UTC, deadalnix wrote:
> Hi all,
>
> 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.
Very intreresting, once support has been added to the druntime
other backends should be able to do the same optimization.
Cheers, Jakob.
|
December 13, 2015 Re: Null check optimization | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | 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
|
Copyright © 1999-2021 by the D Language Foundation