def FeatureLongCalls : SubtargetFeature<"long-calls", "UseLongCalls", "true",
"Disable use of the jal instruction">;
+def FeatureXGOT
+ : SubtargetFeature<"xgot", "UseXGOT", "true", "Assume 32-bit GOT">;
+
def FeatureUseIndirectJumpsHazard : SubtargetFeature<"use-indirect-jump-hazard",
"UseIndirectJumpsHazard",
"true", "Use indirect jump"
STATISTIC(NumTailCalls, "Number of tail calls");
-static cl::opt<bool>
-LargeGOT("mxgot", cl::Hidden,
- cl::desc("MIPS: Enable GOT larger than 64k."), cl::init(false));
-
static cl::opt<bool>
NoZeroDivCheck("mno-check-zero-division", cl::Hidden,
cl::desc("MIPS: Don't trap on integer division by zero."),
!Subtarget.inMicroMipsMode();
// Disable if either of the following is true:
- // We do not generate PIC, the ABI is not O32, LargeGOT is being used.
- if (!TM.isPositionIndependent() || !TM.getABI().IsO32() || LargeGOT)
+ // We do not generate PIC, the ABI is not O32, XGOT is being used.
+ if (!TM.isPositionIndependent() || !TM.getABI().IsO32() ||
+ Subtarget.useXGOT())
UseFastISel = false;
return UseFastISel ? Mips::createFastISel(funcInfo, libInfo) : nullptr;
if (GV->hasLocalLinkage())
return getAddrLocal(N, SDLoc(N), Ty, DAG, ABI.IsN32() || ABI.IsN64());
- if (LargeGOT)
+ if (Subtarget.useXGOT())
return getAddrGlobalLargeGOT(
N, SDLoc(N), Ty, DAG, MipsII::MO_GOT_HI16, MipsII::MO_GOT_LO16,
DAG.getEntryNode(),
if (InternalLinkage)
Callee = getAddrLocal(G, DL, Ty, DAG, ABI.IsN32() || ABI.IsN64());
- else if (LargeGOT) {
+ else if (Subtarget.useXGOT()) {
Callee = getAddrGlobalLargeGOT(G, DL, Ty, DAG, MipsII::MO_CALL_HI16,
MipsII::MO_CALL_LO16, Chain,
FuncInfo->callPtrInfo(Val));
if (!IsPIC) // static
Callee = DAG.getTargetExternalSymbol(
Sym, getPointerTy(DAG.getDataLayout()), MipsII::MO_NO_FLAG);
- else if (LargeGOT) {
+ else if (Subtarget.useXGOT()) {
Callee = getAddrGlobalLargeGOT(S, DL, Ty, DAG, MipsII::MO_CALL_HI16,
MipsII::MO_CALL_LO16, Chain,
FuncInfo->callPtrInfo(Sym));
; RUN: llc -march=mips < %s -debug 2>&1 | FileCheck %s --check-prefix=MIPS
-; RUN: llc -march=mips -relocation-model=pic -mxgot < %s -debug 2>&1 | FileCheck %s --check-prefix=MIPS-XGOT
+; RUN: llc -march=mips -relocation-model=pic -mattr=+xgot < %s \
+; RUN: -debug 2>&1 | FileCheck %s --check-prefix=MIPS-XGOT
; RUN: llc -march=mips -mattr=+micromips < %s -debug 2>&1 | FileCheck %s --check-prefix=MM
-; RUN: llc -march=mips -relocation-model=pic -mxgot -mattr=+micromips < %s -debug 2>&1 | FileCheck %s --check-prefix=MM-XGOT
+; RUN: llc -march=mips -relocation-model=pic -mattr=+xgot,+micromips < %s \
+; RUN: -debug 2>&1 | FileCheck %s --check-prefix=MM-XGOT
; REQUIRES: asserts
-; RUN: llc -march=mipsel -mxgot -relocation-model=pic < %s | FileCheck %s -check-prefix=O32
-; RUN: llc -march=mips64el -mcpu=mips64r2 -mxgot -relocation-model=pic < %s | \
-; RUN: FileCheck %s -check-prefix=N64
-; RUN: llc -march=mipsel -mxgot -relocation-model=pic -fast-isel < %s | FileCheck %s -check-prefix=O32
-; RUN: llc -march=mips64el -mcpu=mips64r2 -mxgot -relocation-model=pic -fast-isel < %s | \
-; RUN: FileCheck %s -check-prefix=N64
+; RUN: llc -march=mipsel -mattr=+xgot \
+; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=O32
+; RUN: llc -march=mips64el -mcpu=mips64r2 -mattr=+xgot \
+; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=N64
+; RUN: llc -march=mipsel -mattr=+xgot -fast-isel \
+; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=O32
+; RUN: llc -march=mips64el -mcpu=mips64r2 -mattr=+xgot -fast-isel \
+; RUN: -relocation-model=pic < %s | FileCheck %s -check-prefix=N64
@v0 = external global i32