[LLVMdev] llvm and flushing instruction cache

Eli Friedman eli.friedman at gmail.com
Sat Mar 6 23:19:28 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.

On x86 in particular, explicitly flushing the instruction cache isn't
necessary; the processor transparently handles modifications to cached
code.

-Eli




More information about the llvm-dev mailing list