[llvm-commits] [llvm] r75229 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86Subtarget.cpp X86Subtarget.h
Chris Lattner
sabre at nondot.org
Thu Jul 9 22:37:11 PDT 2009
Author: lattner
Date: Fri Jul 10 00:37:11 2009
New Revision: 75229
URL: http://llvm.org/viewvc/llvm-project?rev=75229&view=rev
Log:
the "isDirectCall" operand of GVRequiresRegister is always false, eliminate it.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86Subtarget.cpp
llvm/trunk/lib/Target/X86/X86Subtarget.h
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=75229&r1=75228&r2=75229&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Jul 10 00:37:11 2009
@@ -7078,7 +7078,7 @@
if (Subtarget->GVRequiresExtraLoad(AM.BaseGV, getTargetMachine(), false))
return false;
// If BaseGV requires a register, we cannot also have a BaseReg.
- if (Subtarget->GVRequiresRegister(AM.BaseGV, getTargetMachine(), false) &&
+ if (Subtarget->GVRequiresRegister(AM.BaseGV, getTargetMachine()) &&
AM.HasBaseReg)
return false;
@@ -8841,8 +8841,8 @@
}
// 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(), false))
+ if (Subtarget->GVRequiresExtraLoad(GA->getGlobal(), getTargetMachine(),
+ false))
return;
if (hasMemory)
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=75229&r1=75228&r2=75229&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Fri Jul 10 00:37:11 2009
@@ -76,15 +76,14 @@
/// cases where GVRequiresExtraLoad is true. Some variations of PIC require
/// a register, but not an extra load.
bool X86Subtarget::GVRequiresRegister(const GlobalValue *GV,
- const TargetMachine& TM,
- bool isDirectCall) const {
- if (GVRequiresExtraLoad(GV, TM, isDirectCall))
+ const TargetMachine &TM) const {
+ if (GVRequiresExtraLoad(GV, TM, false))
return true;
+
// Code below here need only consider cases where GVRequiresExtraLoad
// returns false.
if (TM.getRelocationModel() == Reloc::PIC_)
- return !isDirectCall &&
- (GV->hasLocalLinkage() || GV->hasExternalLinkage());
+ return GV->hasLocalLinkage() || GV->hasExternalLinkage();
return false;
}
Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=75229&r1=75228&r2=75229&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Fri Jul 10 00:37:11 2009
@@ -201,14 +201,13 @@
/// symbols are indirect, loading the value at address GV rather then the
/// value of GV itself. This means that the GlobalAddress must be in the base
/// or index register of the address, not the GV offset field.
- bool GVRequiresExtraLoad(const GlobalValue* GV, const TargetMachine& TM,
+ bool GVRequiresExtraLoad(const GlobalValue* GV, const TargetMachine &TM,
bool isDirectCall) const;
/// True if accessing the GV requires a register. This is a superset of the
/// cases where GVRequiresExtraLoad is true. Some variations of PIC require
/// a register, but not an extra load.
- bool GVRequiresRegister(const GlobalValue* GV, const TargetMachine& TM,
- bool isDirectCall) const;
+ bool GVRequiresRegister(const GlobalValue* GV, const TargetMachine &TM) const;
/// IsLegalToCallImmediateAddr - Return true if the subtarget allows calls
/// to immediate address.
More information about the llvm-commits
mailing list