[GCOVProfiling] don't profile Fn's w/ noprofile attribute
authorNick Desaulniers <ndesaulniers@google.com>
Fri, 18 Jun 2021 20:58:34 +0000 (13:58 -0700)
committerNick Desaulniers <ndesaulniers@google.com>
Fri, 18 Jun 2021 20:58:34 +0000 (13:58 -0700)
commitbef299286104c2b6383a43b9d1eb0e47838cb5b6
tree6eeaaf747171dc4afff88359174388364459ca76
parent193e41c987127aad86d0380df83e67a85266f1f1
[GCOVProfiling] don't profile Fn's w/ noprofile attribute

Similar to D104475, the Linux kernel would like to avoid compiler
generated code in certain functions. The no_profile function
attribute can be used in C to generate the the noprofile fn attr in IR.
Respect that from GCOVProfiling.

Link: https://lore.kernel.org/lkml/CAKwvOdmPTi93n2L0_yQkrzLdmpxzrOR7zggSzonyaw2PGshApw@mail.gmail.com/
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D104257
llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
llvm/test/Transforms/GCOVProfiling/noprofile.ll [new file with mode: 0644]