diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index b6c9299c65b..3a3f4c7cddf 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -466,10 +466,6 @@ int main(int argc, char **argv, char * const *envp) { exit(1); } - // Clear instruction cache before code will be executed. - if (JMM) - JMM->invalidateInstructionCache(); - // The following functions have no effect if their respective profiling // support wasn't enabled in the build configuration. EE->RegisterJITEventListener( @@ -524,6 +520,10 @@ int main(int argc, char **argv, char * const *envp) { } } + // Clear instruction cache before code will be executed. + if (JMM) + JMM->invalidateInstructionCache(); + // Run main. int Result = EE->runFunctionAsMain(EntryFn, InputArgv, envp);