[llvm-commits] [llvm] r93475 - /llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp

Jeffrey Yasskin jyasskin at google.com
Thu Jan 14 15:15:27 PST 2010


Author: jyasskin
Date: Thu Jan 14 17:15:26 2010
New Revision: 93475

URL: http://llvm.org/viewvc/llvm-project?rev=93475&view=rev
Log:
Teach PPC how to replaceMachineCodeForFunction correctly.  (Fixes
JITTest.FunctionIsRecompiledAndRelinked.)


Modified:
    llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp?rev=93475&r1=93474&r2=93475&view=diff

==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCJITInfo.cpp Thu Jan 14 17:15:26 2010
@@ -308,6 +308,7 @@
   // Rewrite the stub with an unconditional branch to the target, for any users
   // who took the address of the stub.
   EmitBranchToAt((intptr_t)StubCallAddr, (intptr_t)Target, false, is64Bit);
+  sys::Memory::InvalidateInstructionCache(StubCallAddr, 7*4);
 
   // Put the address of the target function to call and the address to return to
   // after calling the target function in a place that is easy to get on the
@@ -441,4 +442,5 @@
 
 void PPCJITInfo::replaceMachineCodeForFunction(void *Old, void *New) {
   EmitBranchToAt((intptr_t)Old, (intptr_t)New, false, is64Bit);
+  sys::Memory::InvalidateInstructionCache(Old, 7*4);
 }





More information about the llvm-commits mailing list