r203546 - test: Regenerate profile data for PGO tests
Justin Bogner
mail at justinbogner.com
Mon Mar 10 23:49:35 PDT 2014
Author: bogner
Date: Tue Mar 11 01:49:34 2014
New Revision: 203546
URL: http://llvm.org/viewvc/llvm-project?rev=203546&view=rev
Log:
test: Regenerate profile data for PGO tests
Some of this data had gotten out of date, so we weren't quite testing
what we thought we were. This also moves the outdated data test to its
own file to simplify regenerating the test data.
Added:
cfe/trunk/test/Profile/Inputs/c-outdated-data.profdata
cfe/trunk/test/Profile/c-outdated-data.c
Modified:
cfe/trunk/test/Profile/Inputs/c-attributes.profdata
cfe/trunk/test/Profile/Inputs/c-general.profdata
cfe/trunk/test/Profile/Inputs/cxx-class.profdata
cfe/trunk/test/Profile/Inputs/objc-general.profdata
cfe/trunk/test/Profile/c-general.c
cfe/trunk/test/Profile/cxx-class.cpp
Modified: cfe/trunk/test/Profile/Inputs/c-attributes.profdata
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/c-attributes.profdata?rev=203546&r1=203545&r2=203546&view=diff
==============================================================================
--- cfe/trunk/test/Profile/Inputs/c-attributes.profdata (original)
+++ cfe/trunk/test/Profile/Inputs/c-attributes.profdata Tue Mar 11 01:49:34 2014
@@ -1,39 +1,24 @@
-hot_100_percent 4
+hot_100_percent 2
100000
4999950000
-0
-0
-hot_40_percent 4
+hot_40_percent 2
40000
799980000
-0
-0
-normal_func 4
+normal_func 2
20000
199990000
-0
-0
-cold_func 4
+cold_func 2
500
124750
-0
-0
-main 13
+main 6
1
-100000
-0
0
+100000
40000
-0
-0
20000
-0
-0
500
-0
-0
Modified: cfe/trunk/test/Profile/Inputs/c-general.profdata
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/c-general.profdata?rev=203546&r1=203545&r2=203546&view=diff
==============================================================================
--- cfe/trunk/test/Profile/Inputs/c-general.profdata (original)
+++ cfe/trunk/test/Profile/Inputs/c-general.profdata Tue Mar 11 01:49:34 2014
@@ -92,9 +92,6 @@ big_switch 17
2
2
-issue_with_one_counter 1
-0
-
boolean_operators 8
1
100
@@ -122,13 +119,6 @@ do_fallthrough 4
2
8
-no_usable_data 5
-1
-1
-1
-1
-1
-
main 1
1
Added: cfe/trunk/test/Profile/Inputs/c-outdated-data.profdata
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/c-outdated-data.profdata?rev=203546&view=auto
==============================================================================
--- cfe/trunk/test/Profile/Inputs/c-outdated-data.profdata (added)
+++ cfe/trunk/test/Profile/Inputs/c-outdated-data.profdata Tue Mar 11 01:49:34 2014
@@ -0,0 +1,8 @@
+no_usable_data 3
+1
+0
+0
+
+main 1
+1
+
Modified: cfe/trunk/test/Profile/Inputs/cxx-class.profdata
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/cxx-class.profdata?rev=203546&r1=203545&r2=203546&view=diff
==============================================================================
--- cfe/trunk/test/Profile/Inputs/cxx-class.profdata (original)
+++ cfe/trunk/test/Profile/Inputs/cxx-class.profdata Tue Mar 11 01:49:34 2014
@@ -1,20 +1,27 @@
-_ZN6SimpleC2Ei 2
+_Z14simple_wrapperv 2
+1
100
-99
-_ZN6Simple6methodEv 2
-100
-99
+main 1
+1
+
+_ZN6SimpleD1Ev 2
+0
+0
_ZN6SimpleD2Ev 2
100
99
-_ZN14simple_wrapperEv 4
-1
+_ZN6Simple6methodEv 2
100
+99
+
+_ZN6SimpleC1Ei 2
0
0
-main 1
-1
+_ZN6SimpleC2Ei 2
+100
+99
+
Modified: cfe/trunk/test/Profile/Inputs/objc-general.profdata
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/Inputs/objc-general.profdata?rev=203546&r1=203545&r2=203546&view=diff
==============================================================================
--- cfe/trunk/test/Profile/Inputs/objc-general.profdata (original)
+++ cfe/trunk/test/Profile/Inputs/objc-general.profdata Tue Mar 11 01:49:34 2014
@@ -8,3 +8,4 @@ objc-general.m:+[A foreach:] 2
main 1
1
+
Modified: cfe/trunk/test/Profile/c-general.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/c-general.c?rev=203546&r1=203545&r2=203546&view=diff
==============================================================================
--- cfe/trunk/test/Profile/c-general.c (original)
+++ cfe/trunk/test/Profile/c-general.c Tue Mar 11 01:49:34 2014
@@ -11,7 +11,6 @@
// PGOGEN: @[[BSC:__llvm_pgo_ctr[0-9]*]] = private global [17 x i64] zeroinitializer
// PGOGEN: @[[BOC:__llvm_pgo_ctr[0-9]*]] = private global [8 x i64] zeroinitializer
// PGOGEN: @[[BLC:__llvm_pgo_ctr[0-9]*]] = private global [9 x i64] zeroinitializer
-// PGOGEN: @[[NOC:__llvm_pgo_ctr[0-9]*]] = private global [2 x i64] zeroinitializer
// PGOGEN: @[[MAC:__llvm_pgo_ctr[0-9]*]] = private global [1 x i64] zeroinitializer
// PGOGEN: @[[STC:__llvm_pgo_ctr[0-9]*]] = private global [2 x i64] zeroinitializer
@@ -426,21 +425,6 @@ void do_fallthrough() {
}
}
-// PGOGEN-LABEL: @no_usable_data()
-// PGOUSE-LABEL: @no_usable_data()
-// PGOGEN: store {{.*}} @[[NOC]], i64 0, i64 0
-void no_usable_data() {
- // The input data for PGOUSE is deliberately invalid for this function, so
- // that we can test that we reject and ignore it properly.
- int i = 0;
-
- // PGOGEN: store {{.*}} @[[NOC]], i64 0, i64 1
- if (i) {}
-
- // PGOGEN-NOT: store {{.*}} @[[NOC]],
- // PGOUSE-NOT: br {{.*}} !prof ![0-9]+
-}
-
// PGOGEN-LABEL: @static_func()
// PGOUSE-LABEL: @static_func()
// PGOGEN: store {{.*}} @[[STC]], i64 0, i64 0
@@ -531,7 +515,6 @@ int main(int argc, const char *argv[]) {
boolean_operators();
boolop_loops();
do_fallthrough();
- no_usable_data();
static_func();
return 0;
}
Added: cfe/trunk/test/Profile/c-outdated-data.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/c-outdated-data.c?rev=203546&view=auto
==============================================================================
--- cfe/trunk/test/Profile/c-outdated-data.c (added)
+++ cfe/trunk/test/Profile/c-outdated-data.c Tue Mar 11 01:49:34 2014
@@ -0,0 +1,24 @@
+// Test that outdated data is ignored.
+
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-outdated-data.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/c-outdated-data.profdata | FileCheck -check-prefix=PGOUSE %s
+
+// TODO: We should have a warning or a remark that tells us the profile data was
+// discarded, rather than just checking that we fail to add metadata.
+
+// PGOUSE-LABEL: @no_usable_data()
+void no_usable_data() {
+ int i = 0;
+
+ if (i) {}
+
+#ifdef GENERATE_OUTDATED_DATA
+ if (i) {}
+#endif
+
+ // PGOUSE-NOT: br {{.*}} !prof ![0-9]+
+}
+
+int main(int argc, const char *argv[]) {
+ no_usable_data();
+ return 0;
+}
Modified: cfe/trunk/test/Profile/cxx-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Profile/cxx-class.cpp?rev=203546&r1=203545&r2=203546&view=diff
==============================================================================
--- cfe/trunk/test/Profile/cxx-class.cpp (original)
+++ cfe/trunk/test/Profile/cxx-class.cpp Tue Mar 11 01:49:34 2014
@@ -69,7 +69,7 @@ void simple_wrapper() {
// WRPUSE-NOT: br {{.*}} !prof ![0-9]+
// WRPUSE: ret
}
-// WRPUSE: ![[SW1]] = metadata !{metadata !"branch_weights", i32 100, i32 2}
+// WRPUSE: ![[SW1]] = metadata !{metadata !"branch_weights", i32 101, i32 2}
int main(int argc, const char *argv[]) {
simple_wrapper();
More information about the cfe-commits
mailing list