diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-10 06:29:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-10 06:29:59 +0000 |
commit | 3b6b36d6f54e780a2947cb1b9efe4eed7c40dc11 (patch) | |
tree | f64b914eb029eb4a6e38b1048e4d8d8d2e3afa5a /lib | |
parent | 07406346ebbf8a958a956eb05c1e04faedfe1e63 (diff) |
change isGlobalStubReference to take target flags instead of a MachineOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86CodeEmitter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/X86/X86ISelLowering.cpp | 1 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 4 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.h | 11 |
4 files changed, 9 insertions, 9 deletions
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp index dff2c36e1f..e3161e5989 100644 --- a/lib/Target/X86/X86CodeEmitter.cpp +++ b/lib/Target/X86/X86CodeEmitter.cpp @@ -301,7 +301,7 @@ static bool gvNeedsNonLazyPtr(const MachineOperand &GVOp, // Return true if this is a reference to a stub containing the address of the // global, not the global itself. - return isGlobalStubReference(GVOp); + return isGlobalStubReference(GVOp.getTargetFlags()); } template<class CodeEmitter> diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index a1bd81b22f..28ee2c3739 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -8839,6 +8839,7 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op, // Otherwise, this isn't something we can handle, reject it. return; } + // If we require an extra load to get this address, as in PIC mode, we // can't accept it. if (Subtarget->GVRequiresExtraLoad(GA->getGlobal(), getTargetMachine())) diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index 3e565313f8..8607db32b3 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -789,7 +789,7 @@ static bool CanRematLoadWithDispOperand(const MachineOperand &MO, if (MO.isGlobal()) { // If this is a load of a stub, not of the global, we can remat it. This // access will always return the address of the global. - if (isGlobalStubReference(MO)) + if (isGlobalStubReference(MO.getTargetFlags())) return true; // If the global itself is constant, we can remat the load. @@ -980,7 +980,7 @@ bool X86InstrInfo::isInvariantLoad(const MachineInstr *MI) const { return true; if (MO.isGlobal()) - return isGlobalStubReference(MO); + return isGlobalStubReference(MO.getTargetFlags()); // If this is a load from an invariant stack slot, the load is a constant. if (MO.isFI()) { diff --git a/lib/Target/X86/X86InstrInfo.h b/lib/Target/X86/X86InstrInfo.h index 0838739468..83f6345275 100644 --- a/lib/Target/X86/X86InstrInfo.h +++ b/lib/Target/X86/X86InstrInfo.h @@ -69,7 +69,8 @@ namespace X86 { /// instruction info tracks. /// namespace X86II { - enum { + /// Target Operand Flag enum. + enum TOF { //===------------------------------------------------------------------===// // X86 Specific MachineOperand flags. @@ -179,15 +180,13 @@ namespace X86II { /// which is a PIC-base-relative reference to a hidden dyld lazy pointer /// stub. MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE = 17 - }; } -/// isGlobalStubReference - Return true if the specified GlobalValue operand is +/// isGlobalStubReference - Return true if the specified TargetFlag operand is /// a reference to a stub for a global, not the global itself. -inline static bool isGlobalStubReference(const MachineOperand &MO) { - assert(MO.isGlobal() && "Predicate only works on globalvalue operands"); - switch (MO.getTargetFlags()) { +inline static bool isGlobalStubReference(unsigned char TargetFlag) { + switch (TargetFlag) { case X86II::MO_DLLIMPORT: // dllimport stub. case X86II::MO_GOTPCREL: // rip-relative GOT reference. case X86II::MO_GOT: // normal GOT reference. |