[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-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 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-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 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-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-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 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

[PATCH] D136846: [Driver] Enable profi flag as user-facing flag

2022-10-27 Thread Zhang Haoyu via Phabricator via cfe-commits
HaoyuZhang created this revision. Herald added a subscriber: wenlei. Herald added a project: All. HaoyuZhang requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Herald added a project: clang. This patch enable -sample-profile-use-profi in Clang frontend as user-facin