[PATCH] D25225: Add an option to save the backend-produced YAML optimization record to a file

Hal Finkel via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 15:45:30 PDT 2016


hfinkel added inline comments.


================
Comment at: lib/CodeGen/CodeGenAction.cpp:198
+
+        Ctx.setDiagnosticsOutputFile(new yaml::Output(OptRecordFile->os()));
+      }
----------------
anemet wrote:
> Sorry, one more thing: if PGO is available, I think we want to set Ctx.setDiagnosticHotnessRequested as well.  Without that, you'd have to pass -fsave-optimization-record and -fdiagnostics-show-hotness to get hotness info into the YAML file which feels strange.  I am certainly fine if we do this later but I wanted to bring it up since it's seems related.
I agree. We shouldn't require -fdiagnostics-show-hotness for that to work.


================
Comment at: test/CodeGen/opt-record.c:17-25
+// CHECK: --- !Missed
+// CHECK: Pass:            inline
+// CHECK: Name:            NoDefinition
+// CHECK: Function:        foo
+
+// CHECK: --- !Passed
+// CHECK: Pass:            loop-vectorize
----------------
anemet wrote:
> Wouldn't this be a good place to also check that we have -gline-tables-only properly hooked up, i.e. CHECK for DebugLoc: as well?
Yes; will do.


https://reviews.llvm.org/D25225





More information about the cfe-commits mailing list