[llvm] r180225 - Making invalidateInstructionCache automatic in SectionMemoryManager

Andrew Kaylor andrew.kaylor at intel.com
Wed Apr 24 15:39:12 PDT 2013


Author: akaylor
Date: Wed Apr 24 17:39:12 2013
New Revision: 180225

URL: http://llvm.org/viewvc/llvm-project?rev=180225&view=rev
Log:
Making invalidateInstructionCache automatic in SectionMemoryManager

Modified:
    llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h
    llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp

Modified: llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h?rev=180225&r1=180224&r2=180225&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/SectionMemoryManager.h Wed Apr 24 17:39:12 2013
@@ -87,9 +87,7 @@ public:
   /// explicit cache flush, otherwise JIT code manipulations (like resolved
   /// relocations) will get to the data cache but not to the instruction cache.
   ///
-  /// This method is not called by RuntimeDyld or MCJIT during the load
-  /// process.  Clients may call this function when needed.  See the lli
-  /// tool for example use.
+  /// This method is called from applyPermissions.
   virtual void invalidateInstructionCache();
 
 private:

Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp?rev=180225&r1=180224&r2=180225&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp Wed Apr 24 17:39:12 2013
@@ -138,6 +138,11 @@ bool SectionMemoryManager::applyPermissi
 
   // Read-write data memory already has the correct permissions
 
+  // Some platforms with separate data cache and instruction cache require
+  // explicit cache flush, otherwise JIT code manipulations (like resolved
+  // relocations) will get to the data cache but not to the instruction cache.
+  invalidateInstructionCache();
+
   return false;
 }
 





More information about the llvm-commits mailing list