[PATCH] D101129: [gcov] Set nounwind and respect module flags metadata "frame-pointer" & "uwtable" for synthesized functions

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 23 14:14:53 PDT 2021


void added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp:1046
+  Function *F = createInternalFunction(FTy, "__llvm_gcov_init");
   F->addFnAttr(Attribute::NoInline);
   if (Options.NoRedZone)
----------------
nickdesaulniers wrote:
> MaskRay wrote:
> > I think not all three functions need `noinline`, so I do not place `noinline` in the common function.
> > 
> > @void Do you know why `noredzone` is needed? Many other instrumentation passes don't set this attribute.
> With KCOV (not GCOV) and LTO, we can and sometimes do inline the coverage runtime helper functions, FWIW.
It's been 8 years... Here's the commit where I added it

```
commit 74f334e476a62d0ddcd4751d266560a503e00d55
Author: Bill Wendling <isanbard at gmail.com>
Date:   Mon Dec 10 19:46:49 2012 +0000

    Don't use a red zone for code coverage if the user specified `-mno-red-zone'.

    The `-mno-red-zone' flag wasn't being propagated to the functions that code
    coverage generates. This allowed some of them to use the red zone when that
    wasn't allowed.
    <rdar://problem/12843084>

    llvm-svn: 169754
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101129/new/

https://reviews.llvm.org/D101129



More information about the llvm-commits mailing list