<div dir="ltr">Hello,<div><br></div><div>There's a bit of duplicated "magic" code in opt.cpp and Clang's CodeGen that computes the inliner threshold from opt level and size opt level.</div><div><br></div>

<div>This patch moves the code to a function that lives alongside the inliner itself, providing a convenient overload to the inliner creation.</div><div><br></div><div>A separate patch can be committed to Clang to use this once it's committed to LLVM. Standalone tools that use the inlining pass can also avoid duplicating this code and fearing it will go out of sync.</div>

<div><br></div><div>PTAL,</div><div>Eli</div><div><br></div></div>