[llvm] r272936 - Refactor duplicated code.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 16 11:50:13 PDT 2016
Author: rafael
Date: Thu Jun 16 13:50:12 2016
New Revision: 272936
URL: http://llvm.org/viewvc/llvm-project?rev=272936&view=rev
Log:
Refactor duplicated code.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=272936&r1=272935&r2=272936&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jun 16 13:50:12 2016
@@ -13024,6 +13024,8 @@ X86TargetLowering::LowerGlobalTLSAddress
const GlobalValue *GV = GA->getGlobal();
auto PtrVT = getPointerTy(DAG.getDataLayout());
+ bool PositionIndependent =
+ DAG.getTarget().getRelocationModel() == Reloc::PIC_;
if (Subtarget.isTargetELF()) {
TLSModel::Model model = DAG.getTarget().getTLSModel(GV);
@@ -13038,8 +13040,7 @@ X86TargetLowering::LowerGlobalTLSAddress
case TLSModel::InitialExec:
case TLSModel::LocalExec:
return LowerToTLSExecModel(GA, DAG, PtrVT, model, Subtarget.is64Bit(),
- DAG.getTarget().getRelocationModel() ==
- Reloc::PIC_);
+ PositionIndependent);
}
llvm_unreachable("Unknown TLS model.");
}
@@ -13052,8 +13053,7 @@ X86TargetLowering::LowerGlobalTLSAddress
// In PIC mode (unless we're in RIPRel PIC mode) we add an offset to the
// global base reg.
- bool PIC32 = (DAG.getTarget().getRelocationModel() == Reloc::PIC_) &&
- !Subtarget.is64Bit();
+ bool PIC32 = PositionIndependent && !Subtarget.is64Bit();
if (PIC32)
OpFlag = X86II::MO_TLVP_PIC_BASE;
else
More information about the llvm-commits
mailing list