From 9a5f84facbb7ecf11f37011bf0314543a126cc0d Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Fri, 29 Apr 2011 22:49:50 +0000 Subject: Add -Oz option and use it to set the inline threshold to 25. Radar 9333566. Patch by Chad Rosier! llvm-svn: 130554 --- clang/lib/CodeGen/BackendUtil.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/BackendUtil.cpp') diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index 9bd4bfd70c7..497ccc54eef 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -134,8 +134,10 @@ void EmitAssemblyHelper::CreatePasses() { // // FIXME: Derive these constants in a principled fashion. unsigned Threshold = 225; - if (CodeGenOpts.OptimizeSize) + if (CodeGenOpts.OptimizeSize == 1) //-Os Threshold = 75; + else if (CodeGenOpts.OptimizeSize == 2) //-Oz + Threshold = 25; else if (OptLevel > 2) Threshold = 275; InliningPass = createFunctionInliningPass(Threshold); -- cgit v1.2.3