Move some X86 subtarget configuration onto the subtarget that's being

created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215271 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2014-08-09 01:07:25 +00:00
parent 4e8a136db8
commit d0ba0f6dd1
2 changed files with 22 additions and 21 deletions

View File

@@ -13,6 +13,7 @@
#include "X86Subtarget.h"
#include "X86InstrInfo.h"
#include "X86TargetMachine.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
@@ -357,7 +358,27 @@ X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
InstrInfo(initializeSubtargetDependencies(CPU, FS)), TLInfo(TM),
FrameLowering(TargetFrameLowering::StackGrowsDown, getStackAlignment(),
is64Bit() ? -8 : -4),
JITInfo(hasSSE1()) {}
JITInfo(hasSSE1()) {
// Determine the PICStyle based on the target selected.
if (TM.getRelocationModel() == Reloc::Static) {
// Unless we're in PIC or DynamicNoPIC mode, set the PIC style to None.
setPICStyle(PICStyles::None);
} else if (is64Bit()) {
// PIC in 64 bit mode is always rip-rel.
setPICStyle(PICStyles::RIPRel);
} else if (isTargetCOFF()) {
setPICStyle(PICStyles::None);
} else if (isTargetDarwin()) {
if (TM.getRelocationModel() == Reloc::PIC_)
setPICStyle(PICStyles::StubPIC);
else {
assert(TM.getRelocationModel() == Reloc::DynamicNoPIC);
setPICStyle(PICStyles::StubDynamicNoPIC);
}
} else if (isTargetELF()) {
setPICStyle(PICStyles::GOT);
}
}
bool X86Subtarget::enableEarlyIfConversion() const {
return hasCMov() && X86EarlyIfConv;