[PATCH] D28404: IRGen: Add optnone attribute on function during O0

Paul Robinson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 10 15:04:59 PST 2017

probinson added a comment.

In https://reviews.llvm.org/D28404#641757, @chandlerc wrote:

>   % ag OptimizeNone lib/Transforms/IPO
>   lib/Transforms/IPO/ForceFunctionAttrs.cpp
>   47:      .Case("optnone", Attribute::OptimizeNone)

This is implementing a debugging option, not skipping a pass.

>   lib/Transforms/IPO/Inliner.cpp
>   813:    if (F.hasFnAttribute(Attribute::OptimizeNone))

This is declining to operate on a callee, not skipping a pass.  Given that optnone is supposed to be paired with noinline, wouldn't this be redundant?

>   lib/Transforms/IPO/InferFunctionAttrs.cpp
>   30:    if (F.isDeclaration() && !F.hasFnAttribute((Attribute::OptimizeNone)))
>   lib/Transforms/IPO/FunctionAttrs.cpp
>   1056:    if (F.hasFnAttribute(Attribute::OptimizeNone)) {
>   1137:    if (!F || F->hasFnAttribute(Attribute::OptimizeNone)) {

This is SCC stuff, which I don't really understand what it is trying to do.  I wonder whether 'noinline' ought to be the relevant attribute, though.


More information about the cfe-commits mailing list