Remove the use of getSubtarget in the creation of the X86

PassManager instance. In one case we can make the determination
from the Triple, in the other (execution dependency pass) the
pass will avoid running if we don't have any code that uses that
register class so go ahead and add it to the pipeline.

llvm-svn: 228334
This commit is contained in:
Eric Christopher 2015-02-05 19:27:04 +00:00
parent d361ff8282
commit 24f3f65196
1 changed files with 3 additions and 6 deletions

View File

@ -186,10 +186,6 @@ public:
return getTM<X86TargetMachine>();
}
const X86Subtarget &getX86Subtarget() const {
return *getX86TargetMachine().getSubtargetImpl();
}
void addIRPasses() override;
bool addInstSelector() override;
bool addILPOpts() override;
@ -214,7 +210,8 @@ bool X86PassConfig::addInstSelector() {
addPass(createX86ISelDag(getX86TargetMachine(), getOptLevel()));
// For ELF, cleanup any local-dynamic TLS accesses.
if (getX86Subtarget().isTargetELF() && getOptLevel() != CodeGenOpt::None)
if (Triple(TM->getTargetTriple()).isOSBinFormatELF() &&
getOptLevel() != CodeGenOpt::None)
addPass(createCleanupLocalDynamicTLSPass());
addPass(createX86GlobalBaseRegPass());
@ -236,7 +233,7 @@ void X86PassConfig::addPostRegAlloc() {
}
void X86PassConfig::addPreEmitPass() {
if (getOptLevel() != CodeGenOpt::None && getX86Subtarget().hasSSE2())
if (getOptLevel() != CodeGenOpt::None)
addPass(createExecutionDependencyFixPass(&X86::VR128RegClass));
if (UseVZeroUpper)