Index: lib/CodeGen/MachineScheduler.cpp =================================================================== --- lib/CodeGen/MachineScheduler.cpp +++ lib/CodeGen/MachineScheduler.cpp @@ -317,8 +317,12 @@ if (EnableMachineSched.getNumOccurrences()) { if (!EnableMachineSched) return false; - } else if (!mf.getSubtarget().enableMachineScheduler()) - return false; + } else { + if (skipOptnoneFunction(*mf.getFunction())) + return false; + if (!mf.getSubtarget().enableMachineScheduler()) + return false; + } DEBUG(dbgs() << "Before MISched:\n"; mf.print(dbgs()));