[PATCH] Add flag -fauto-profile as alias to -fprofile-sample-use.

Chandler Carruth chandlerc at gmail.com
Fri Dec 6 09:55:46 PST 2013


LGTM
On Dec 6, 2013 6:36 AM, "Diego Novillo" <dnovillo at google.com> wrote:

> Hi chandlerc,
>
> GCC uses -fauto-profile to enable sample-based PGO. This patch
> adds it to Clang as an alias for -fprofile-sample-use.
>
> OK for trunk?
>
> http://llvm-reviews.chandlerc.com/D2353
>
> Files:
>   include/clang/Driver/Options.td
>   test/Driver/clang_f_opts.c
>
> Index: include/clang/Driver/Options.td
> ===================================================================
> --- include/clang/Driver/Options.td
> +++ include/clang/Driver/Options.td
> @@ -369,6 +369,8 @@
>  def fprofile_sample_use_EQ : Joined<["-"], "fprofile-sample-use=">,
>      Group<f_Group>, Flags<[DriverOption, CC1Option]>,
>      HelpText<"Enable sample-based profile guided optimizations">;
> +def fauto_profile_EQ : Joined<["-"], "fauto-profile=">,
> +    Alias<fprofile_sample_use_EQ>;
>
>  def fblocks : Flag<["-"], "fblocks">, Group<f_Group>, Flags<[CC1Option]>,
>    HelpText<"Enable the 'blocks' language feature">;
> Index: test/Driver/clang_f_opts.c
> ===================================================================
> --- test/Driver/clang_f_opts.c
> +++ test/Driver/clang_f_opts.c
> @@ -54,6 +54,9 @@
>  // RUN: %clang -### -S -fprofile-sample-use=%S/Inputs/file.prof %s 2>&1 |
> FileCheck -check-prefix=CHECK-SAMPLE-PROFILE %s
>  // CHECK-SAMPLE-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
>
> +// RUN: %clang -### -S -fauto-profile=%S/Inputs/file.prof %s 2>&1 |
> FileCheck -check-prefix=CHECK-AUTO-PROFILE %s
> +// CHECK-AUTO-PROFILE: "-fprofile-sample-use={{.*}}/file.prof"
> +
>  // RUN: %clang -### -S -fvectorize %s 2>&1 | FileCheck
> -check-prefix=CHECK-VECTORIZE %s
>  // RUN: %clang -### -S -fno-vectorize -fvectorize %s 2>&1 | FileCheck
> -check-prefix=CHECK-VECTORIZE %s
>  // RUN: %clang -### -S -fno-vectorize %s 2>&1 | FileCheck
> -check-prefix=CHECK-NO-VECTORIZE %s
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131206/acb2f447/attachment.html>


More information about the llvm-commits mailing list