[llvm-commits] [llvm] r54142 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Bruno Cardoso Lopes
bruno.cardoso at gmail.com
Mon Jul 28 12:26:26 PDT 2008
Author: bruno
Date: Mon Jul 28 14:26:25 2008
New Revision: 54142
URL: http://llvm.org/viewvc/llvm-project?rev=54142&view=rev
Log:
Disable gp_rel relocation for constant pools access for now.
Modified:
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=54142&r1=54141&r2=54142&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Mon Jul 28 14:26:25 2008
@@ -440,16 +440,20 @@
SDValue CP = DAG.getTargetConstantPool(C, MVT::i32, N->getAlignment());
// gp_rel relocation
- if (!Subtarget->hasABICall() &&
- IsInSmallSection(getTargetData()->getABITypeSize(C->getType()))) {
- SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP);
- SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32);
- ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode);
- } else { // %hi/%lo relocation
+ // FIXME: we should reference the constant pool using small data sections,
+ // but the asm printer currently doens't support this feature without
+ // hacking it. This feature should come soon so we can uncomment the
+ // stuff below.
+ //if (!Subtarget->hasABICall() &&
+ // IsInSmallSection(getTargetData()->getABITypeSize(C->getType()))) {
+ // SDValue GPRelNode = DAG.getNode(MipsISD::GPRel, MVT::i32, CP);
+ // SDValue GOT = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i32);
+ // ResNode = DAG.getNode(ISD::ADD, MVT::i32, GOT, GPRelNode);
+ //} else { // %hi/%lo relocation
SDValue HiPart = DAG.getNode(MipsISD::Hi, MVT::i32, CP);
SDValue Lo = DAG.getNode(MipsISD::Lo, MVT::i32, CP);
ResNode = DAG.getNode(ISD::ADD, MVT::i32, HiPart, Lo);
- }
+ //}
return ResNode;
}
More information about the llvm-commits
mailing list