[PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

David Li via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 23 15:14:26 PST 2016


davidxl added inline comments.

================
Comment at: include/clang/Frontend/CodeGenOptions.h:83
@@ -82,2 +82,3 @@
   enum ProfileInstrKind {
     ProfileNoInstr,    // No instrumentation.
+    ProfileClangInstr, // Clang instrumentation to generate execution counts
----------------
Maybe ProfileNone, // Profile instrumentation and use is turned off.

================
Comment at: lib/CodeGen/CodeGenModule.cpp:151
@@ -151,1 +150,3 @@
+  if (CodeGenOpts.hasProfileClangUse() &&
+      !CodeGenOpts.InstrProfileInput.empty()) {
     auto ReaderOrErr =
----------------
Is the second condition still needed? Should it be asserted ?

================
Comment at: test/CodeGen/pgo-instrumentation.c:4
@@ +3,3 @@
+// Ensure Pass PGOInstrumentationGenPass is invoked.
+// RUN: %clang-cc1 -O2 -fprofile-instrument=llvm %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN
+// CHECK-PGOGENPASS-INVOKED-INSTR-GEN: PGOInstrumentationGenPass
----------------
should be %clang_cc1

================
Comment at: test/CodeGen/pgo-instrumentation.c:8
@@ +7,3 @@
+// Ensure Pass PGOInstrumentationGenPass is not invoked.
+// RUN: %clang-cc1 -O2 -fprofile-instrument=clang %s -mllvm -debug-pass=Structure -emit-llvm -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG
+// CHECK-PGOGENPASS-INVOKED-INSTR-GEN-CLANG-NOT: PGOInstrumentationGenPass
----------------
%clang_cc1


http://reviews.llvm.org/D15829





More information about the cfe-commits mailing list