This is an archive of the discontinued LLVM Phabricator instance.

Allow -inline-threshold to override default (explicitly specified/derived from opt levels) threshold
ClosedPublic

Authored by eraman on May 19 2016, 3:41 PM.

Details

Summary

Before r257832, the threshold used by SimpleInliner was explicitly specified or generated from opt levels and passed to the base class Inliner's constructor. There, it was first overridden by explicitly specified -inline-threshold. The refactoring in r257832 did not preserve this behavior for all opt levels. This change brings back the original behavior.

Diff Detail

Repository
rL LLVM

Event Timeline

eraman updated this revision to Diff 57867.May 19 2016, 3:41 PM
eraman retitled this revision from to Allow -inline-threshold to override default (explicitly specified/derived from opt levels) threshold.
eraman updated this object.
eraman added reviewers: chandlerc, hfinkel.
eraman added subscribers: llvm-commits, jhowarth.
chandlerc accepted this revision.May 19 2016, 3:44 PM
chandlerc edited edge metadata.

Thanks for fixing this! LGTM with the tweak below.

lib/Analysis/InlineCost.cpp
624–627 ↗(On Diff #57867)

How about reversing the condition above? It seems much more natural to write

if (/* we have an explicit option */) {
  // use it...
} else {
  // use the thresholds
}
This revision is now accepted and ready to land.May 19 2016, 3:44 PM
This revision was automatically updated to reflect the committed changes.
eraman marked an inline comment as done.
eraman added inline comments.May 19 2016, 4:08 PM
lib/Analysis/InlineCost.cpp
624–627 ↗(On Diff #57867)

I've reversed the condition and also moved the comment at line 616 near the relevant code.