[InlineCost] Add flag to allow changing the default inline cost
authorTeresa Johnson <tejohnson@google.com>
Tue, 4 Feb 2020 18:37:53 +0000 (10:37 -0800)
committerTeresa Johnson <tejohnson@google.com>
Tue, 4 Feb 2020 20:06:20 +0000 (12:06 -0800)
commit7f37a8026f6cfe51479309733be642102428fee4
treebba16c88a756a3914ac35dcdc77b8b56186476b8
parent5d2749938c4ec0b44fe3d63e355e3f31d8b4078f
[InlineCost] Add flag to allow changing the default inline cost

Summary:
It can be useful to tune the default inline threshold without overriding other inlining thresholds (e.g. in code compiled for size).

The existing `-inline-threshold` flag overrides other thresholds, so it is insufficient in codebases where there is a mix of code compiled for size and speed.

Patch by Michael Holman <michael.holman@microsoft.com>

Reviewers: eraman, tejohnson

Reviewed By: tejohnson

Subscribers: tejohnson, mtrofin, davidxl, hiraditya, haicheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73217
llvm/lib/Analysis/InlineCost.cpp
llvm/test/Transforms/Inline/inlinedefault-threshold.ll [new file with mode: 0644]