[PATCH] D20647: Add flag to add InlineHint attribute on implicitly inline functions

Rudy Pons via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 20 16:21:29 PDT 2016


Ilod updated this revision to Diff 61318.
Ilod added a comment.

New patch, which instead add NoInline to function not marked (implicitly or explicitly) inline, when we use the -finline-hint-functions flag (effectily inlining only implicitly and explicitly inline functions). Also adds support for /Ob1, since it's now an alias for it.
There is no longer a flag to treat implicit and explicit inline functions exactly the same way, I don't kow if it's really useful (it can be if we want to use the threshold difference between InlineHint and standard functions). If it's wanted for other uses, I can re-add it.
There is no flag to inline only explicitly marked inline functions, but it can be done by passing -finline-functions -mllvm -inline-threshold=-1000 (which will add InlineHint only to explicitly inline functions, and put a negative enough threshold for non-hinted functions to inline only the hinted ones).


http://reviews.llvm.org/D20647

Files:
  include/clang/Driver/CLCompatOptions.td
  include/clang/Driver/Options.td
  include/clang/Frontend/CodeGenOptions.h
  lib/CodeGen/BackendUtil.cpp
  lib/CodeGen/CodeGenFunction.cpp
  lib/Driver/MSVCToolChain.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/CodeGen/inline-optim.c
  test/CodeGenCXX/inline-hint.cpp
  test/Driver/cl-options.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20647.61318.patch
Type: text/x-patch
Size: 12416 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160620/e9a15d70/attachment.bin>


More information about the cfe-commits mailing list