From af4e64d0955aa47fd6e286ce48eeeed9a9ec7a4a Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Thu, 6 Feb 2014 00:07:05 +0000 Subject: Disable most IR-level transform passes on functions marked 'optnone'. Ideally only those transform passes that run at -O0 remain enabled, in reality we get as close as we reasonably can. Passes are responsible for disabling themselves, it's not the job of the pass manager to do it for them. llvm-svn: 200892 --- llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp') diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 8371f6d3527..f1e3ac573ec 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -168,6 +168,9 @@ static bool iterativelySimplifyCFG(Function &F, const TargetTransformInfo &TTI, // simplify the CFG. // bool CFGSimplifyPass::runOnFunction(Function &F) { + if (skipOptnoneFunction(F)) + return false; + const TargetTransformInfo &TTI = getAnalysis(); const DataLayout *TD = getAnalysisIfAvailable(); bool EverChanged = removeUnreachableBlocks(F); -- cgit v1.2.3