PGO: Statically generate data structures

Duncan P. N. Exon Smith dexonsmith at apple.com
Sat Mar 15 08:44:55 PDT 2014


On 2014 Mar 14, at 21:57, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:

> Thanks for the review!

I’ve attached updated patches that address your comments.

>>> void CodeGenPGO::setFuncName(llvm::Function *Fn) {
>>> -  StringRef Func = Fn->getName();
>>> +  NormalFuncName = Fn->getName();
>> 
>> NormalFuncName? Is there a SpecialFuncName? This is just FunctionName,
>> isn't it?
> 
> There are three function names kicking around there:
> 
> - Fn->getName(), which sometimes has a \01 prefix.
> 
> - NormalFuncName, which takes off the \01 prefix.  It’s used as a suffix
>   for symbol names, like the “foo” in __llvm_pgo_counts_foo.
> 
> - FuncName, which already existed, and whose name I didn’t want to
>   change, and for static variables has a filename prefix.  E.g.,
>   “somefile.cpp:foo" if foo() is static and defined in somefile.cpp, or
>   “bar" if bar() is not static.  This is what gets saved in
>   __llvm_pgo_name_foo (or __llvm_pgo_name_bar) and used to be sent as an
>   argument into llvm_pgo_writeout().
> 
> NormalFuncName is normal in that it has no \01 or filename prefix.
> 
> I’m open to suggestions, but FunctionName would clash awkwardly with
> FuncName.

I renamed both.

  - FuncName => PrefixedFuncName
  - NormalFuncName => RawFuncName

I don’t like either name, since Prefixed isn’t always prefixed and
Raw seems to indicate (incorrectly) that it includes the \01, but I
think it’s an improvement.  Let me know if you come up with
something better.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgo-static-data-structures-clang-2.patch
Type: application/octet-stream
Size: 29842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140315/a3a43200/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgo-static-data-structures-compiler-rt-2.patch
Type: application/octet-stream
Size: 5796 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140315/a3a43200/attachment-0001.obj>


More information about the cfe-commits mailing list