From 572d0698d26dbea4ae18eb949f2a2839b149b47e Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Thu, 20 Sep 2012 08:46:30 +0000 Subject: [PATCH] Make sure lli compiles all code before invalidating instruction caches. Patch from Amara Emerson. llvm-svn: 164296 --- llvm/tools/lli/lli.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 4004b6c4d408..c5645ec6015f 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -656,6 +656,9 @@ int main(int argc, char **argv, char * const *envp) { Target.stop(); } else { + // Trigger compilation separately so code regions that need to be + // invalidated will be known. + (void)EE->getPointerToFunction(EntryFn); // Clear instruction cache before code will be executed. if (JMM) static_cast(JMM)->invalidateInstructionCache();