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

Zhang Haoyu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 1 19:26:35 PDT 2022


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 fno_profile_sample_accurate : Flag<["-"], "fno-profile-sample-accurate">,
----------------
hans wrote:
> Thanks, this is much better!
> 
> (nit: s/converting/convert/)
Modified.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:5768
+    } else {
+      D.Diag(diag::err_drv_argument_only_allowed_with)
+          << "-fsample-profile-use-profi"
----------------
hans wrote:
> I think if you did instead:
> 
> ```
> if (getLastProfileSampleUseArg(Args) && Args.hasArg(options::OPT_fsample_profile_use_profi)) {
>   CmdArgs.push_back(...
> }
> ```
> 
> then clang would warn about the option being unused if profile use is not enabled.
Thank you for the guidance. Updated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136846



More information about the cfe-commits mailing list