r255366 - [PGO] Stop using invalid char in instr variable names.

Sean Silva via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 11 17:22:57 PST 2015


On Fri, Dec 11, 2015 at 11:53 AM, Xinliang David Li via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: davidxl
> Date: Fri Dec 11 13:53:35 2015
> New Revision: 255366
>
> URL: http://llvm.org/viewvc/llvm-project?rev=255366&view=rev
> Log:
> [PGO] Stop using invalid char in instr variable names.
>
> (This is part-2 of the patch -- fixing test cases)
>
> Before the patch, -fprofile-instr-generate compile will fail
> if no integrated-as is specified when the file contains
> any static functions (the -S output is also invalid).
>
> This patch fixed the issue. With the change, the index format
> version will be bumped up by 1. Backward compatibility is
> preserved with this change.
>
> Differential Revision: http://reviews.llvm.org/D15243


FYI, this was a bit premature. There had been no review of the testing that
v3 format continued to be accepted (which you snuck in with clang-side
patches that had not been discussed; also, testing an llvm feature inside
clang is generally not allowed (i.e. a piece of code in LLVM that is only
exercised by clang)).

In general, for compatibility-related issues extra careful review is
required. I recommend you reopen the review and continue the discussion,
including the clang-side patches and the strange testing arrangement for
testing that v3 continues to be accepted and correctly interpreted.

-- Sean Silva


>
>
>
>
> Modified:
>     cfe/trunk/test/CoverageMapping/unused_names.c
>     cfe/trunk/test/Profile/Inputs/c-captured.proftext
>     cfe/trunk/test/Profile/Inputs/c-general.proftext
>     cfe/trunk/test/Profile/Inputs/cxx-lambda.proftext
>     cfe/trunk/test/Profile/Inputs/objc-general.proftext
>     cfe/trunk/test/Profile/c-captured.c
>     cfe/trunk/test/Profile/c-general.c
>     cfe/trunk/test/Profile/c-linkage.c
>     cfe/trunk/test/Profile/cxx-lambda.cpp
>     cfe/trunk/test/Profile/objc-general.m
>
> Modified: cfe/trunk/test/CoverageMapping/unused_names.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CoverageMapping/unused_names.c?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/CoverageMapping/unused_names.c (original)
> +++ cfe/trunk/test/CoverageMapping/unused_names.c Fri Dec 11 13:53:35 2015
> @@ -6,7 +6,7 @@
>
>  // CHECK-DAG: @__llvm_profile_name_bar = {{.*}} [3 x i8] c"bar", section
> "{{.*}}__llvm_prf_names"
>  // CHECK-DAG: @__llvm_profile_name_baz = {{.*}} [3 x i8] c"baz", section
> "{{.*}}__llvm_prf_names"
> -// CHECK-DAG: @"__llvm_profile_name_unused_names.c:qux" = {{.*}} [18 x
> i8] c"unused_names.c:qux", section "{{.*}}__llvm_prf_names"
> +// CHECK-DAG: @__llvm_profile_name_unused_names.c__qux = {{.*}} [19 x i8]
> c"unused_names.c__qux", section "{{.*}}__llvm_prf_names"
>
>  // SYSHEADER-NOT: @__llvm_profile_name_foo =
>
>
> Modified: cfe/trunk/test/Profile/Inputs/c-captured.proftext
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/c-captured.proftext?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/Inputs/c-captured.proftext (original)
> +++ cfe/trunk/test/Profile/Inputs/c-captured.proftext Fri Dec 11 13:53:35
> 2015
> @@ -1,10 +1,10 @@
> -c-captured.c:__captured_stmt
> +c-captured.c____captured_stmt
>  10
>  2
>  1
>  1
>
> -c-captured.c:__captured_stmt.1
> +c-captured.c____captured_stmt.1
>  266
>  3
>  1
>
> Modified: cfe/trunk/test/Profile/Inputs/c-general.proftext
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/c-general.proftext?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/Inputs/c-general.proftext (original)
> +++ cfe/trunk/test/Profile/Inputs/c-general.proftext Fri Dec 11 13:53:35
> 2015
> @@ -149,7 +149,7 @@ main
>  1
>  1
>
> -c-general.c:static_func
> +c-general.c__static_func
>  4
>  2
>  1
>
> Modified: cfe/trunk/test/Profile/Inputs/cxx-lambda.proftext
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/cxx-lambda.proftext?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/Inputs/cxx-lambda.proftext (original)
> +++ cfe/trunk/test/Profile/Inputs/cxx-lambda.proftext Fri Dec 11 13:53:35
> 2015
> @@ -1,4 +1,4 @@
> -cxx-lambda.cpp:_ZZ7lambdasvENK3$_0clEi
> +cxx-lambda.cpp___ZZ7lambdasvENK3$_0clEi
>  654
>  3
>  10
>
> Modified: cfe/trunk/test/Profile/Inputs/objc-general.proftext
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/objc-general.proftext?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/Inputs/objc-general.proftext (original)
> +++ cfe/trunk/test/Profile/Inputs/objc-general.proftext Fri Dec 11
> 13:53:35 2015
> @@ -1,10 +1,10 @@
> -objc-general.m:__13+[A foreach:]_block_invoke
> +objc-general.m____13+[A foreach:]_block_invoke
>  10
>  2
>  2
>  1
>
> -objc-general.m:+[A foreach:]
> +objc-general.m__+[A foreach:]
>  6
>  2
>  1
>
> Modified: cfe/trunk/test/Profile/c-captured.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/c-captured.c?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/c-captured.c (original)
> +++ cfe/trunk/test/Profile/c-captured.c Fri Dec 11 13:53:35 2015
> @@ -4,8 +4,8 @@
>  // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name
> c-captured.c %s -o - -emit-llvm -fprofile-instr-use=%t.profdata | FileCheck
> -check-prefix=PGOUSE -check-prefix=PGOALL %s
>
>  // PGOGEN: @[[DCC:__llvm_profile_counters_debug_captured]] = private
> global [3 x i64] zeroinitializer
> -// PGOGEN:
> @[[CSC:"__llvm_profile_counters_c-captured.c:__captured_stmt"]] = private
> global [2 x i64] zeroinitializer
> -// PGOGEN:
> @[[C1C:"__llvm_profile_counters_c-captured.c:__captured_stmt.1"]] = private
> global [3 x i64] zeroinitializer
> +// PGOGEN: @[[CSC:__llvm_profile_counters_c-captured.c____captured_stmt]]
> = private global [2 x i64] zeroinitializer
> +// PGOGEN:
> @[[C1C:__llvm_profile_counters_c-captured.c____captured_stmt.1]] = private
> global [3 x i64] zeroinitializer
>
>  // PGOALL-LABEL: define void @debug_captured()
>  // PGOGEN: store {{.*}} @[[DCC]], i64 0, i64 0
>
> Modified: cfe/trunk/test/Profile/c-general.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/c-general.c?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/c-general.c (original)
> +++ cfe/trunk/test/Profile/c-general.c Fri Dec 11 13:53:35 2015
> @@ -19,7 +19,7 @@
>  // PGOGEN: @[[COC:__llvm_profile_counters_conditional_operator]] =
> private global [3 x i64] zeroinitializer
>  // PGOGEN: @[[DFC:__llvm_profile_counters_do_fallthrough]] = private
> global [4 x i64] zeroinitializer
>  // PGOGEN: @[[MAC:__llvm_profile_counters_main]] = private global [1 x
> i64] zeroinitializer
> -// PGOGEN: @[[STC:"__llvm_profile_counters_c-general.c:static_func"]] =
> private global [2 x i64] zeroinitializer
> +// PGOGEN: @[[STC:__llvm_profile_counters_c-general.c__static_func]] =
> private global [2 x i64] zeroinitializer
>
>  // PGOGEN-LABEL: @simple_loops()
>  // PGOUSE-LABEL: @simple_loops()
>
> Modified: cfe/trunk/test/Profile/c-linkage.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/c-linkage.c?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/c-linkage.c (original)
> +++ cfe/trunk/test/Profile/c-linkage.c Fri Dec 11 13:53:35 2015
> @@ -4,7 +4,7 @@
>  // CHECK: @__llvm_profile_name_foo = private constant [3 x i8] c"foo"
>  // CHECK: @__llvm_profile_name_foo_weak = weak hidden constant [8 x i8]
> c"foo_weak"
>  // CHECK: @__llvm_profile_name_main = private constant [4 x i8] c"main"
> -// CHECK: @"__llvm_profile_name_c-linkage.c:foo_internal" = private
> constant [24 x i8] c"c-linkage.c:foo_internal"
> +// CHECK: @__llvm_profile_name_c-linkage.c__foo_internal = private
> constant [25 x i8] c"c-linkage.c__foo_internal"
>
>  void foo(void) { }
>
>
> Modified: cfe/trunk/test/Profile/cxx-lambda.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/cxx-lambda.cpp?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/cxx-lambda.cpp (original)
> +++ cfe/trunk/test/Profile/cxx-lambda.cpp Fri Dec 11 13:53:35 2015
> @@ -11,7 +11,7 @@
>
>  // PGOGEN: @[[LWC:__llvm_profile_counters__Z7lambdasv]] = private global
> [4 x i64] zeroinitializer
>  // PGOGEN: @[[MAC:__llvm_profile_counters_main]] = private global [1 x
> i64] zeroinitializer
> -// LMBGEN:
> @[[LFC:"__llvm_profile_counters_cxx-lambda.cpp:_ZZ7lambdasvENK3\$_0clEi"]]
> = private global [3 x i64] zeroinitializer
> +// LMBGEN:
> @[[LFC:"__llvm_profile_counters_cxx-lambda.cpp___ZZ7lambdasvENK3\$_0clEi"]]
> = private global [3 x i64] zeroinitializer
>
>  // PGOGEN-LABEL: define {{.*}}void @_Z7lambdasv()
>  // PGOUSE-LABEL: define {{.*}}void @_Z7lambdasv()
>
> Modified: cfe/trunk/test/Profile/objc-general.m
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/objc-general.m?rev=255366&r1=255365&r2=255366&view=diff
>
> ==============================================================================
> --- cfe/trunk/test/Profile/objc-general.m (original)
> +++ cfe/trunk/test/Profile/objc-general.m Fri Dec 11 13:53:35 2015
> @@ -31,8 +31,8 @@ struct NSFastEnumerationState;
>  @end;
>  #endif
>
> -// PGOGEN: @[[FRC:"__llvm_profile_counters_objc-general.m:\+\[A
> foreach:\]"]] = private global [2 x i64] zeroinitializer
> -// PGOGEN: @[[BLC:"__llvm_profile_counters_objc-general.m:__13\+\[A
> foreach:\]_block_invoke"]] = private global [2 x i64] zeroinitializer
> +// PGOGEN: @[[FRC:"__llvm_profile_counters_objc-general.m__\+\[A
> foreach:\]"]] = private global [2 x i64] zeroinitializer
> +// PGOGEN: @[[BLC:"__llvm_profile_counters_objc-general.m____13\+\[A
> foreach:\]_block_invoke"]] = private global [2 x i64] zeroinitializer
>  // PGOGEN: @[[MAC:__llvm_profile_counters_main]] = private global [1 x
> i64] zeroinitializer
>
>  @interface A : NSObject
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151211/8f9337ca/attachment-0001.html>


More information about the cfe-commits mailing list