summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2017-12-01 19:59:42 +0000
committerAdam Nemet <anemet@apple.com>2017-12-01 19:59:42 +0000
commit2729a96bf74ca3ed8c4a5e2fc652cd1e61f9050c (patch)
tree77a50733c24711934bec947348885ee9f4568dd7
parent67be3529f24be093baacfa589619963b7c079644 (diff)
downloadbcm5719-llvm-2729a96bf74ca3ed8c4a5e2fc652cd1e61f9050c.tar.gz
bcm5719-llvm-2729a96bf74ca3ed8c4a5e2fc652cd1e61f9050c.zip
Fix opt-remark with hotness testcase for sample-based PGO
1. Require hotness on all remark lines with -verify. 3. Fix the samplePGO file to actually produce hotness on each line. The second remark has hotness 60 rather 30 which I don't quite understand but testing this is strictly better than before. It also unblocks the commit of D40678. llvm-svn: 319577
-rw-r--r--clang/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext10
-rw-r--r--clang/test/Frontend/optimization-remark-with-hotness.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/clang/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext b/clang/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
index 730dc4a0d5b..0eef9bdc012 100644
--- a/clang/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
+++ b/clang/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
@@ -1,7 +1,7 @@
-foo:0:0
- 0: 0
+foo:29:29
+ 0: 29
bar:29:29
- 9: foo:0
-main:0:0
- 0: 0 bar:0
+ 8: 29 foo:29
+main:29:1
+ 3: 29 bar:29
diff --git a/clang/test/Frontend/optimization-remark-with-hotness.c b/clang/test/Frontend/optimization-remark-with-hotness.c
index 06e1b8af363..ca9d020cb51 100644
--- a/clang/test/Frontend/optimization-remark-with-hotness.c
+++ b/clang/test/Frontend/optimization-remark-with-hotness.c
@@ -56,13 +56,13 @@ void bar(int x) {
// THRESHOLD-NOT: hotness
// NO_PGO: '-fdiagnostics-show-hotness' requires profile-guided optimization information
// NO_PGO: '-fdiagnostics-hotness-threshold=' requires profile-guided optimization information
- // expected-remark@+1 {{foo inlined into bar with cost=always}}
+ // expected-remark@+1 {{foo inlined into bar with cost=always (hotness:}}
sum += foo(x, x - 2);
}
int main(int argc, const char *argv[]) {
for (int i = 0; i < 30; i++)
- // expected-remark@+1 {{bar not inlined into main because it should never be inlined}}
+ // expected-remark@+1 {{bar not inlined into main because it should never be inlined (cost=never) (hotness:}}
bar(argc);
return sum;
}
OpenPOWER on IntegriCloud