summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2014-03-12 16:30:34 +0000
committerEli Bendersky <eliben@google.com>2014-03-12 16:30:34 +0000
commitb5cfa8c2f3d88676a5e4349cbe4d7ccf3a2c7a22 (patch)
treea7b392adbe871f59a6efa4bdb4f98ec6e5ffcfe8 /clang/lib/CodeGen/BackendUtil.cpp
parent16860ec6404ca207e60f577956d7f5c0a5bbd988 (diff)
downloadbcm5719-llvm-b5cfa8c2f3d88676a5e4349cbe4d7ccf3a2c7a22.tar.gz
bcm5719-llvm-b5cfa8c2f3d88676a5e4349cbe4d7ccf3a2c7a22.zip
Don't recompute inlining threshold - use new overload provided by LLVM
Follow-up on LLVM r203669 llvm-svn: 203673
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 92154385333..eee32925a78 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -308,19 +308,12 @@ void EmitAssemblyHelper::CreatePasses() {
PMBuilder.LibraryInfo = new TargetLibraryInfo(TargetTriple);
if (!CodeGenOpts.SimplifyLibCalls)
PMBuilder.LibraryInfo->disableAllFunctions();
-
+
switch (Inlining) {
case CodeGenOptions::NoInlining: break;
case CodeGenOptions::NormalInlining: {
- // FIXME: Derive these constants in a principled fashion.
- unsigned Threshold = 225;
- if (CodeGenOpts.OptimizeSize == 1) // -Os
- Threshold = 75;
- else if (CodeGenOpts.OptimizeSize == 2) // -Oz
- Threshold = 25;
- else if (OptLevel > 2)
- Threshold = 275;
- PMBuilder.Inliner = createFunctionInliningPass(Threshold);
+ PMBuilder.Inliner =
+ createFunctionInliningPass(OptLevel, CodeGenOpts.OptimizeSize);
break;
}
case CodeGenOptions::OnlyAlwaysInlining:
OpenPOWER on IntegriCloud