[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp
Evan Cheng
evan.cheng at apple.com
Thu May 3 17:27:17 PDT 2007
Changes in directory llvm/lib/Target/ARM:
ARMISelLowering.cpp updated: 1.49 -> 1.50
---
Log message:
On Mac OS X, GV requires an extra load only when relocation-model is non-static.
---
Diffs of the changes: (+6 -5)
ARMISelLowering.cpp | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
Index: llvm/lib/Target/ARM/ARMISelLowering.cpp
diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.50
--- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.49 Thu May 3 15:28:35 2007
+++ llvm/lib/Target/ARM/ARMISelLowering.cpp Thu May 3 19:26:58 2007
@@ -812,10 +812,11 @@
}
/// GVIsIndirectSymbol - true if the GV will be accessed via an indirect symbol
-/// even in dynamic-no-pic mode.
-static bool GVIsIndirectSymbol(GlobalValue *GV) {
- return (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
- (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode()));
+/// even in non-static mode.
+static bool GVIsIndirectSymbol(GlobalValue *GV, Reloc::Model RelocM) {
+ return RelocM != Reloc::Static &&
+ (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
+ (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode()));
}
SDOperand ARMTargetLowering::LowerGlobalAddressDarwin(SDOperand Op,
@@ -823,7 +824,7 @@
MVT::ValueType PtrVT = getPointerTy();
GlobalValue *GV = cast<GlobalAddressSDNode>(Op)->getGlobal();
Reloc::Model RelocM = getTargetMachine().getRelocationModel();
- bool IsIndirect = GVIsIndirectSymbol(GV);
+ bool IsIndirect = GVIsIndirectSymbol(GV, RelocM);
SDOperand CPAddr;
if (RelocM == Reloc::Static)
CPAddr = DAG.getTargetConstantPool(GV, PtrVT, 2);
More information about the llvm-commits
mailing list