Index: lib/Target/PowerPC/PPCBoolRetToInt.cpp =================================================================== --- lib/Target/PowerPC/PPCBoolRetToInt.cpp +++ lib/Target/PowerPC/PPCBoolRetToInt.cpp @@ -168,6 +168,9 @@ } bool runOnFunction(Function &F) { + if (skipFunction(F)) + return false; + PHINodeSet PromotablePHINodes = getPromotablePHINodes(F); B2IMap Bool2IntMap; bool Changed = false; Index: lib/Target/PowerPC/PPCCTRLoops.cpp =================================================================== --- lib/Target/PowerPC/PPCCTRLoops.cpp +++ lib/Target/PowerPC/PPCCTRLoops.cpp @@ -166,6 +166,9 @@ #endif // NDEBUG bool PPCCTRLoops::runOnFunction(Function &F) { + if (skipFunction(F)) + return false; + LI = &getAnalysis().getLoopInfo(); SE = &getAnalysis().getSE(); DT = &getAnalysis().getDomTree(); Index: lib/Target/PowerPC/PPCEarlyReturn.cpp =================================================================== --- lib/Target/PowerPC/PPCEarlyReturn.cpp +++ lib/Target/PowerPC/PPCEarlyReturn.cpp @@ -173,6 +173,9 @@ public: bool runOnMachineFunction(MachineFunction &MF) override { + if (skipFunction(*MF.getFunction())) + return false; + TII = MF.getSubtarget().getInstrInfo(); bool Changed = false; Index: lib/Target/PowerPC/PPCLoopPreIncPrep.cpp =================================================================== --- lib/Target/PowerPC/PPCLoopPreIncPrep.cpp +++ lib/Target/PowerPC/PPCLoopPreIncPrep.cpp @@ -144,6 +144,9 @@ } bool PPCLoopPreIncPrep::runOnFunction(Function &F) { + if (skipFunction(F)) + return false; + LI = &getAnalysis().getLoopInfo(); SE = &getAnalysis().getSE(); auto *DTWP = getAnalysisIfAvailable(); Index: lib/Target/PowerPC/PPCMIPeephole.cpp =================================================================== --- lib/Target/PowerPC/PPCMIPeephole.cpp +++ lib/Target/PowerPC/PPCMIPeephole.cpp @@ -63,6 +63,8 @@ public: // Main entry point for this pass. bool runOnMachineFunction(MachineFunction &MF) override { + if (skipFunction(*MF.getFunction())) + return false; initialize(MF); return simplifyCode(); } Index: lib/Target/PowerPC/PPCQPXLoadSplat.cpp =================================================================== --- lib/Target/PowerPC/PPCQPXLoadSplat.cpp +++ lib/Target/PowerPC/PPCQPXLoadSplat.cpp @@ -60,6 +60,9 @@ } bool PPCQPXLoadSplat::runOnMachineFunction(MachineFunction &MF) { + if (skipFunction(*MF.getFunction())) + return false; + bool MadeChange = false; const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo(); Index: lib/Target/PowerPC/PPCTargetMachine.cpp =================================================================== --- lib/Target/PowerPC/PPCTargetMachine.cpp +++ lib/Target/PowerPC/PPCTargetMachine.cpp @@ -382,9 +382,11 @@ } void PPCPassConfig::addPreRegAlloc() { - initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry()); - insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID, - &PPCVSXFMAMutateID); + if (getOptLevel() != CodeGenOpt::None) { + initializePPCVSXFMAMutatePass(*PassRegistry::getPassRegistry()); + insertPass(VSXFMAMutateEarly ? &RegisterCoalescerID : &MachineSchedulerID, + &PPCVSXFMAMutateID); + } if (getPPCTargetMachine().getRelocationModel() == Reloc::PIC_) addPass(createPPCTLSDynamicCallPass()); if (EnableExtraTOCRegDeps) Index: lib/Target/PowerPC/PPCVSXFMAMutate.cpp =================================================================== --- lib/Target/PowerPC/PPCVSXFMAMutate.cpp +++ lib/Target/PowerPC/PPCVSXFMAMutate.cpp @@ -342,6 +342,9 @@ public: bool runOnMachineFunction(MachineFunction &MF) override { + if (skipFunction(*MF.getFunction())) + return false; + // If we don't have VSX then go ahead and return without doing // anything. const PPCSubtarget &STI = MF.getSubtarget(); Index: lib/Target/PowerPC/PPCVSXSwapRemoval.cpp =================================================================== --- lib/Target/PowerPC/PPCVSXSwapRemoval.cpp +++ lib/Target/PowerPC/PPCVSXSwapRemoval.cpp @@ -191,6 +191,9 @@ public: // Main entry point for this pass. bool runOnMachineFunction(MachineFunction &MF) override { + if (skipFunction(*MF.getFunction())) + return false; + // If we don't have VSX on the subtarget, don't do anything. const PPCSubtarget &STI = MF.getSubtarget(); if (!STI.hasVSX())