From: Eric Christopher Date: Thu, 5 Feb 2015 19:27:04 +0000 (+0000) Subject: Remove the use of getSubtarget in the creation of the X86 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a4ed04095cb61b6819bcaea3fb8d6e16ec6e49fe;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228334 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 78fe430c7f6..be22d619eec 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -186,10 +186,6 @@ public: return getTM(); } - 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)