[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-07 Thread Phoebe Wang via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG13f83365cdb5: [Driver] Add -fsample-profile-use-profi (authored by HaoyuZhang, committed by pengfei). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136846/ne

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-06 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added a comment. Thanks @MaskRay and @wenlei for the reviewing. New version for using dummy file has been updated. Comment at: clang/test/Driver/pgo-sample-use-profi.c:2 +/// Test if profi flat is enabled in frontend as user-facing feature. +// RUN: %clang -c -fsamp

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-06 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang updated this revision to Diff 473533. HaoyuZhang added a comment. Use a dummy file instead of cross-directory test file reference. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136846/new/ https://reviews.llvm.org/D136846 Files: clang

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-05 Thread Wenlei He via Phabricator via cfe-commits
wenlei added a comment. In D136846#3910272 , @MaskRay wrote: > In D136846#3890699 , @wenlei wrote: > >> Did you see measurable perf boost with profi on autofdo? Or what motivated >> you to turn on profi? In most

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-05 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. In D136846#3890699 , @wenlei wrote: > Did you see measurable perf boost with profi on autofdo? Or what motivated > you to turn on profi? In most cas

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-03 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added a comment. Thank you for the updating and comments from @spupyrev and @MaskRay . Comment at: clang/docs/UsersManual.rst:2244 + [OPTIONAL] During the sampling, the profiles may have errors or missing + blocks. Profi (profile inference) algorithm can infer bl

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-03 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang updated this revision to Diff 473122. HaoyuZhang added a comment. 1. modified the documentation. 2. omit '.' in HelpText. 3. fix format in test case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136846/new/ https://reviews.llvm.org/D136

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-03 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay requested changes to this revision. MaskRay added inline comments. This revision now requires changes to proceed. Comment at: clang/docs/UsersManual.rst:2246 + blocks. Profi (profile inference) algorithm can infer block and edge counts + to fix them. For applying this,

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-03 Thread Sergey Pupyrev via Phabricator via cfe-commits
spupyrev added a comment. Thanks @HaoyuZhang for adding the flag and the documentation. I just edited the message a bit; otherwise looks good. Comment at: clang/docs/UsersManual.rst:2244 + [OPTIONAL] During the sampling, the profiles may have errors or missing + blocks. Pr

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-03 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added inline comments. Comment at: clang/include/clang/Driver/Options.td:1254 +HelpText<"Use profi to infer block and edge counts.">, +DocBrief<[{Profi - a flow-based profile inference algorithm is an extended + and significantly re-engineered cla

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-03 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added a comment. Hi @spupyrev , the using of profi algorithm is added as a user-facing flag in this patch. And I wrote the documentation in https://clang.llvm.org/docs/UsersManual.html#profile-guided-optimization. Do you have any comments about these? Hi @MaskRay , some updates have

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-03 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang updated this revision to Diff 472877. HaoyuZhang added a comment. 1. add the documentation for this driver. 2. fix a small grammer mistake in Options.td. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136846/new/ https://reviews.llvm.org/

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-02 Thread Hans Wennborg via Phabricator via cfe-commits
hans accepted this revision. hans added a comment. lgtm Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136846/new/ https://reviews.llvm.org/D136846 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-01 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added a comment. New version updated. PTAL~ Comment at: clang/include/clang/Driver/Options.td:1257 + basic block counts to branch probabilites to fix them by extended + and re-engineered classic MCMF (min-cost max-flow) approach.}]>; def

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-01 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang updated this revision to Diff 472487. HaoyuZhang added a comment. 1. Fix spelling grammar mistake in DocBrief. 2. Using tools::getLastProfileSampleUseArg instead of D.Diag(diag::err...) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136846

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-01 Thread Hans Wennborg via Phabricator via cfe-commits
hans added inline comments. Comment at: clang/include/clang/Driver/Options.td:1254 +HelpText<"Use profi to infer block and edge counts.">, +DocBrief<[{Profi - a flow-based profile inference algorithm is an extended + and significantly re-engineered classic M

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-01 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added inline comments. Comment at: clang/include/clang/Driver/Options.td:1254 +HelpText<"Use profi to infer block and edge counts.">, +DocBrief<[{Profi - a flow-based profile inference algorithm is an extended + and significantly re-engineered cla

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-11-01 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang updated this revision to Diff 472219. HaoyuZhang added a comment. 1. Modify the DocBrief contents for fsample-profile-use-profi. 2. Add a checking for -fsample-profile-use-profi that this args only allowed with -fprofile-sample-use (has a profile). 3. Modify the test case and change th

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-10-31 Thread Hans Wennborg via Phabricator via cfe-commits
hans added inline comments. Comment at: clang/include/clang/Driver/Options.td:1254 +HelpText<"Use profi to infer block and edge counts.">, +DocBrief<[{Profi - a flow-based profile inference algorithm is an extended + and significantly re-engineered classic M

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-10-30 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang updated this revision to Diff 471895. HaoyuZhang added a comment. Remove the prof file uploaded previous for test. No more need. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136846/new/ https://reviews.llvm.org/D136846 Files: clang/i

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-10-30 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added a comment. Thanks for the comments. The modifications have been finished. PTAL~ Comment at: clang/include/clang/Driver/Options.td:1253 +Flags<[NoXarchOption, CC1Option]>, Group, +HelpText<"Use profi to infer block and edge counts.">; def fno_profile_sa

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-10-30 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang updated this revision to Diff 471894. HaoyuZhang added a comment. [Driver] Add -fsample-profile-use-profi This patch enable -sample-profile-use-profi in Clang frontend as user-facing feature. By using this patch, we can use the cflag of -fsample-profile-use-profi instead of -mllvm -sam

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-10-28 Thread Hans Wennborg via Phabricator via cfe-commits
hans added inline comments. Comment at: clang/include/clang/Driver/Options.td:1253 +Flags<[NoXarchOption, CC1Option]>, Group, +HelpText<"Use profi to infer block and edge counts.">; def fno_profile_sample_accurate : Flag<["-"], "fno-profile-sample-accurate">, ---

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-10-27 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added a comment. Sorry for not providing the enough information about our investigation. We have opened an issue to show that there are some perf boost with profi on autofdo base on Intel Alder Lake platform by experimen

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-10-27 Thread Wenlei He via Phabricator via cfe-commits
wenlei added a comment. Did you see measurable perf boost with profi on autofdo? Or what motivated you to turn on profi? In most cases, profi helps when csspgo is used (instead of traditional autofdo). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D136846: [Driver] Add -fsample-profile-use-profi

2022-10-27 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang added a comment. Thank you for the comments. The subject has been modified. For wenlei's comment, I am working on a Chromium patch for enabling profi algorithm in Chrome OS. The reviewer Hans hope an user-facing fl