[llvm-commits] CVS: llvm/include/llvm/Target/TargetJITInfo.h

Evan Cheng evan.cheng at apple.com
Tue Jul 25 13:41:11 PDT 2006



Changes in directory llvm/include/llvm/Target:

TargetJITInfo.h updated: 1.7 -> 1.8
---
Log message:

- Refactor the code that resolve basic block references to a TargetJITInfo
  method.
- Added synchronizeICache() to TargetJITInfo. It is called after each block
  of code is emitted to flush the icache. This ensures correct execution
  on targets that have separate dcache and icache.
- Added PPC / Mac OS X specific code to do icache flushing.



---
Diffs of the changes:  (+19 -0)

 TargetJITInfo.h |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+)


Index: llvm/include/llvm/Target/TargetJITInfo.h
diff -u llvm/include/llvm/Target/TargetJITInfo.h:1.7 llvm/include/llvm/Target/TargetJITInfo.h:1.8
--- llvm/include/llvm/Target/TargetJITInfo.h:1.7	Fri Jul 22 15:46:42 2005
+++ llvm/include/llvm/Target/TargetJITInfo.h	Tue Jul 25 15:40:54 2006
@@ -18,10 +18,12 @@
 #define LLVM_TARGET_TARGETJITINFO_H
 
 #include <cassert>
+#include <vector>
 
 namespace llvm {
   class Function;
   class FunctionPassManager;
+  class MachineBasicBlock;
   class MachineCodeEmitter;
   class MachineRelocation;
 
@@ -81,6 +83,20 @@
       assert(NumRelocs == 0 && "This target does not have relocations!");
     }
 
+    /// resolveBBRefs - Resolve branches to BasicBlocks for the JIT emitted
+    /// function.
+    virtual void resolveBBRefs(MachineCodeEmitter &MCE) {}
+
+    /// synchronizeICache - On some targets, the JIT emitted code must be
+    /// explicitly refetched to ensure correct execution.
+    virtual void synchronizeICache(const void *Addr, size_t len) {}
+
+    /// addBBRef - Add a BasicBlock reference to be resolved after the function
+    /// is emitted.
+    void addBBRef(MachineBasicBlock *BB, intptr_t PC) {
+      BBRefs.push_back(std::make_pair(BB, PC));
+    }
+
     /// needsGOT - Allows a target to specify that it would like the
     // JIT to manage a GOT for it.
     bool needsGOT() const { return useGOT; }
@@ -88,6 +104,9 @@
   protected:
     bool useGOT;
 
+    // Tracks which instruction references which BasicBlock
+    std::vector<std::pair<MachineBasicBlock*, intptr_t> > BBRefs;
+    
   };
 } // End llvm namespace
 






More information about the llvm-commits mailing list