[llvm-commits] [llvm] r75236 - in /llvm/trunk/lib/Target/X86: X86CodeEmitter.cpp X86ISelLowering.cpp X86InstrInfo.cpp X86InstrInfo.h
Chris Lattner
sabre at nondot.org
Thu Jul 9 23:29:59 PDT 2009
Author: lattner
Date: Fri Jul 10 01:29:59 2009
New Revision: 75236
URL: http://llvm.org/viewvc/llvm-project?rev=75236&view=rev
Log:
change isGlobalStubReference to take target flags instead of a MachineOperand.
Modified:
llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
llvm/trunk/lib/Target/X86/X86InstrInfo.h
Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=75236&r1=75235&r2=75236&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Fri Jul 10 01:29:59 2009
@@ -301,7 +301,7 @@
// 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>
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=75236&r1=75235&r2=75236&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Jul 10 01:29:59 2009
@@ -8839,6 +8839,7 @@
// 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()))
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=75236&r1=75235&r2=75236&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Fri Jul 10 01:29:59 2009
@@ -789,7 +789,7 @@
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 @@
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()) {
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.h?rev=75236&r1=75235&r2=75236&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.h Fri Jul 10 01:29:59 2009
@@ -69,7 +69,8 @@
/// instruction info tracks.
///
namespace X86II {
- enum {
+ /// Target Operand Flag enum.
+ enum TOF {
//===------------------------------------------------------------------===//
// X86 Specific MachineOperand flags.
@@ -179,15 +180,13 @@
/// 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.
More information about the llvm-commits
mailing list