Instruction Prefetching in llvm

HI,

Has anyone ever implemented instruction prefetching with llvm? If so, on which architectures?

Grep prefetch in lib/Target/* will show you ARM, X86, and PPC seems
have implemented prefetch instruction. LLVM provides prefetch intrinsic
[1] so that you can insert it in LLVM IR as a hint to code generator.
I guess you need to write a pass to lower the intrinsic call to your
target code.

HTH,
chenwj

[1] http://llvm.org/docs/LangRef.html#llvm-prefetch-intrinsic

Hi Chenwj,

The prefetch intrinsic in llvm seems to be useful for only data prefetching i.e data into d-cache. When I try to prefetch instructions into i-cache, it does not work. Would you know anything about how to resolve this issue?