[llvm-commits] [llvm] r48922 - /llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Evan Cheng
evan.cheng at apple.com
Fri Mar 28 10:49:06 PDT 2008
Author: evancheng
Date: Fri Mar 28 12:49:06 2008
New Revision: 48922
URL: http://llvm.org/viewvc/llvm-project?rev=48922&view=rev
Log:
Backing out 48911 for now. It's breaking stuff.
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=48922&r1=48921&r2=48922&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Fri Mar 28 12:49:06 2008
@@ -748,12 +748,6 @@
}
return isPICBase;
}
-
-/// isGVStub - Return true if the GV requires an extra load to get the
-/// real address.
-static inline bool isGVStub(GlobalValue *GV, X86TargetMachine &TM) {
- return TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(GV, TM, false);
-}
bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const {
switch (MI->getOpcode()) {
@@ -775,9 +769,7 @@
if (MI->getOperand(1).isReg() &&
MI->getOperand(2).isImm() &&
MI->getOperand(3).isReg() && MI->getOperand(3).getReg() == 0 &&
- (MI->getOperand(4).isCPI() ||
- (MI->getOperand(4).isGlobal() &&
- isGVStub(MI->getOperand(4).getGlobal(), TM)))) {
+ MI->getOperand(4).isCPI()) {
unsigned BaseReg = MI->getOperand(1).getReg();
if (BaseReg == 0)
return true;
@@ -839,9 +831,13 @@
// Loads from constant pools are trivially invariant.
if (MO.isCPI())
return true;
-
- if (MO.isGlobal())
- return isGVStub(MO.getGlobal(), TM);
+
+ if (MO.isGlobal()) {
+ if (TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(MO.getGlobal(),
+ TM, false))
+ return true;
+ return false;
+ }
// If this is a load from an invariant stack slot, the load is a constant.
if (MO.isFI()) {
More information about the llvm-commits
mailing list