[llvm] [PGO]add bitcode-use-sample-profile (PR #66178)

William Junda Huang via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 12:21:19 PDT 2023


huangjd wrote:

> Also, if you are going to use an internal attribute, how about using the existing -mllvm -force-attribute=use-sample-profile. The ForceFunctionAttrs pass runs early in the ThinLTO pre-link pipeline, before sample pgo.

`-force-attribute` needs a function name, like ` -force-attribute=foo:use-sample-profile`, so it is unfeasible to apply it to every function in the IR. Although it is quite easy to add support for wildcard like ` -force-attribute=*:use-sample-profile` and I think this sounds like an elegant solution 

https://github.com/llvm/llvm-project/pull/66178


More information about the llvm-commits mailing list