r319577 - Fix opt-remark with hotness testcase for sample-based PGO

Adam Nemet via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 11:59:42 PST 2017


Author: anemet
Date: Fri Dec  1 11:59:42 2017
New Revision: 319577

URL: http://llvm.org/viewvc/llvm-project?rev=319577&view=rev
Log:
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.

Modified:
    cfe/trunk/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
    cfe/trunk/test/Frontend/optimization-remark-with-hotness.c

Modified: cfe/trunk/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext?rev=319577&r1=319576&r2=319577&view=diff
==============================================================================
--- cfe/trunk/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext (original)
+++ cfe/trunk/test/Frontend/Inputs/optimization-remark-with-hotness-sample.proftext Fri Dec  1 11:59:42 2017
@@ -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
 

Modified: cfe/trunk/test/Frontend/optimization-remark-with-hotness.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/optimization-remark-with-hotness.c?rev=319577&r1=319576&r2=319577&view=diff
==============================================================================
--- cfe/trunk/test/Frontend/optimization-remark-with-hotness.c (original)
+++ cfe/trunk/test/Frontend/optimization-remark-with-hotness.c Fri Dec  1 11:59:42 2017
@@ -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 at +1 {{foo inlined into bar with cost=always}}
+  // expected-remark at +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 at +1 {{bar not inlined into main because it should never be inlined}}
+    // expected-remark at +1 {{bar not inlined into main because it should never be inlined (cost=never) (hotness:}}
     bar(argc);
   return sum;
 }




More information about the cfe-commits mailing list