Another step forward in PPC64 JIT support: we now no-longer need stubs
emitted for external globals in PPC64-JIT-PIC mode (which is good because
we didn't handle them before!).
This also fixes a bug handling the picbase delta, which we would get wrong
in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32451 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCSubtarget.h b/lib/Target/PowerPC/PPCSubtarget.h
index 1cce24d..e8ad25f 100644
--- a/lib/Target/PowerPC/PPCSubtarget.h
+++ b/lib/Target/PowerPC/PPCSubtarget.h
@@ -21,9 +21,13 @@
namespace llvm {
class Module;
-
+class GlobalValue;
+class TargetMachine;
+
class PPCSubtarget : public TargetSubtarget {
protected:
+ const TargetMachine &TM;
+
/// stackAlignment - The minimum alignment known to hold of the stack frame on
/// entry to the function and which must be maintained by every function.
unsigned StackAlignment;
@@ -40,15 +44,21 @@
bool HasFSQRT;
bool HasSTFIWX;
bool IsDarwin;
+ bool HasLazyResolverStubs;
public:
/// This constructor initializes the data members to match that
/// of the specified module.
///
- PPCSubtarget(const Module &M, const std::string &FS, bool is64Bit);
+ PPCSubtarget(const TargetMachine &TM, const Module &M,
+ const std::string &FS, bool is64Bit);
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
void ParseSubtargetFeatures(const std::string &FS, const std::string &CPU);
+
+ /// SetJITMode - This is called to inform the subtarget info that we are
+ /// producing code for the JIT.
+ void SetJITMode();
/// getStackAlignment - Returns the minimum alignment known to hold of the
/// stack frame on entry to the function and which must be maintained by every
@@ -78,6 +88,10 @@
/// has64BitSupport() returns true.
bool use64BitRegs() const { return Use64BitRegs; }
+ /// hasLazyResolverStub - Return true if accesses to the specified global have
+ /// to go through a dyld lazy resolution stub. This means that an extra load
+ /// is required to get the address of the global.
+ bool hasLazyResolverStub(const GlobalValue *GV) const;
// Specific obvious features.
bool hasFSQRT() const { return HasFSQRT; }