core.intrinsics
Johan Engelen via Digitalmars-d
digitalmars-d at puremagic.com
Fri Oct 14 05:09:14 PDT 2016
On Friday, 14 October 2016 at 11:53:55 UTC, Andrei Alexandrescu
wrote:
> On 10/14/2016 07:51 AM, Johan Engelen wrote:
>> On Friday, 14 October 2016 at 11:17:55 UTC, Andrei
>> Alexandrescu wrote:
>>> On 10/14/2016 05:24 AM, Johan Engelen wrote:
>>>> I like "hints".
>>>
>>> How many other hints are out there? -- Andrei
>>
>> Things that come to mind:
>> - this value is probably X (bool, int, pointer)
>
> These would be all covered by __builtin_expect or similar.
For LLVM, not (yet?) for pointers (there is not builtin for the
is_likely template that I posted).
>> - this type is probably Y
>> - this function is likely hot/cold (UDA)
>> - this data is likely to be accessed soon (_could_ lead to a
>> prefetch)
>> - this member field is hot/cold (iirc, Class members may be
>> re-ordered)
>> (UDA)
>
> Any of these present in existing implementations?
I only know about LLVM/LDC.
- type is probably Y: No. It can be used for devirtualization
(similar to the fptr optimization), and I have implemented it in
LDC using profiling data (it's not in master).
- function hotness: No, but trivially added.
- data prefetching: Yes.
- member field hotness + reordering: No, but it is easy to
imagine how to implement it.
More information about the Digitalmars-d
mailing list