On 22 Jan 2012, at 11:04, Sven Barth wrote:

> Ah... inside the compiler's sources. I thought you meant "the compiler 
> inserts calls to prefetch in specific situations". ^^

It can also do that, if you compile it with -dprefetchnext (at least if that 
still works, it's been a long time since I implemented and tried that). In that 
case, it will look for constructs like this:

while assigned(hp) do
  begin
    ...
    hp:=hp^.next;
  end;

and it will insert prefetch instructions like this:

while assigned(hp) do
  begin
    prefetch(hp^.next^);
    ...
    hp:=hp^.next;
  end;

I don't remember exactly, but I think it will also consider class fields as 
implicit pointers and insert the transformation there. At least for the 
compiler cycle this optimization does not change anything though.


Jonas_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to