aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Target/TargetJITInfo.h3
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp5
2 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetJITInfo.h b/include/llvm/Target/TargetJITInfo.h
index 142f0efbd3..09ef15eb49 100644
--- a/include/llvm/Target/TargetJITInfo.h
+++ b/include/llvm/Target/TargetJITInfo.h
@@ -107,6 +107,9 @@ namespace llvm {
// JIT to manage a GOT for it.
bool needsGOT() const { return useGOT; }
+ /// hasCustomConstantPool - Allows a target to specify that constant
+ /// pool address resolution is handled by the target.
+ virtual bool hasCustomConstantPool() const { return false; }
protected:
bool useGOT;
};
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 73346fe99e..9f020e3ae3 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -1013,6 +1013,11 @@ void* JITEmitter::allocateSpace(intptr_t Size, unsigned Alignment) {
}
void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
+ if (TheJIT->getJITInfo().hasCustomConstantPool()) {
+ DOUT << "JIT: Target has custom constant pool handling. Omitting standard "
+ "constant pool\n";
+ return;
+ }
const std::vector<MachineConstantPoolEntry> &Constants = MCP->getConstants();
if (Constants.empty()) return;