PATCH: Refactor the inliner threshold settings into a function
rafael.espindola at gmail.com
Wed Mar 12 07:51:05 PDT 2014
+int computeThresholdFromOptLevels(unsigned OptLevel, unsigned SizeOptLevel)
Make it static for clarity. The function could probably early returns:
if (OptLevel > 2)
if (SizeOptLevel == 1)
if (SizeOptLevel == 2)
LGTM with that.
On 11 March 2014 18:59, Eli Bendersky <eliben at google.com> wrote:
> 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.
> This patch moves the code to a function that lives alongside the inliner
> itself, providing a convenient overload to the inliner creation.
> 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.
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
More information about the llvm-commits