Make sure lli compiles all code before invalidating instruction caches.

Patch from Amara Emerson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164296 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 4004b6c..c5645ec 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -656,6 +656,9 @@
 
     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<LLIMCJITMemoryManager*>(JMM)->invalidateInstructionCache();