[LLVMdev] llvm and flushing instruction cache
Jeffrey Yasskin
jyasskin at google.com
Sat Mar 6 22:59:54 PST 2010
On Sat, Mar 6, 2010 at 10:34 PM, Shasank Chavan
<shanko_chavano at hotmail.com> wrote:
> Hi. I have a very quick question. Is the instruction cache flushed by the
> llvm jit before code in memory is written to or executed? I'm assuming so,
> but I can't find where in the source code this is happening. In particular
> I searched for clflush, invd, and wbinvd instructions, but couldn't find
> them. And if it's not necessary to do this, can you please explain why?
> (I'm assuming the target platform has a separate L1 i-cache). Thanks.
In general, yes. It's possible there are cases we've missed (I fixed
one in the last couple months), in which case please let us know. The
actual code is in sys::Memory::InvalidateInstructionCache
(http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Memory.cpp?view=markup),
called by, for example,
lib/Target/PowerPC/PPCJITInfo.cpp:PPCCompilationCallbackC().
More information about the llvm-dev
mailing list