[PATCH] D27744: Create SampleProfileLoader pass in llvm instead of clang

2016-12-14 Thread Dehao Chen via Phabricator via cfe-commits
danielcdh reopened this revision.
danielcdh added a comment.
This revision is now accepted and ready to land.

was reverted due to bot breaking


https://reviews.llvm.org/D27744



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D27744: Create SampleProfileLoader pass in llvm instead of clang

2016-12-14 Thread Diego Novillo via Phabricator via cfe-commits
dnovillo accepted this revision.
dnovillo added a comment.
This revision is now accepted and ready to land.

LGTM


https://reviews.llvm.org/D27744



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D27744: Create SampleProfileLoader pass in llvm instead of clang

2016-12-13 Thread Dehao Chen via Phabricator via cfe-commits
danielcdh created this revision.
danielcdh added reviewers: dnovillo, tejohnson, davidxl.
danielcdh added a subscriber: cfe-commits.
Herald added a subscriber: mehdi_amini.

We used to create SampleProfileLoader pass in clang. This makes LTO/ThinLTO 
unable to add this pass in the linker plugin. This patch moves the 
SampleProfileLoader pass creation from
clang to llvm pass manager builder.


https://reviews.llvm.org/D27744

Files:
  lib/CodeGen/BackendUtil.cpp


Index: lib/CodeGen/BackendUtil.cpp
===
--- lib/CodeGen/BackendUtil.cpp
+++ lib/CodeGen/BackendUtil.cpp
@@ -464,10 +464,8 @@
   if (CodeGenOpts.hasProfileIRUse())
 PMBuilder.PGOInstrUse = CodeGenOpts.ProfileInstrumentUsePath;
 
-  if (!CodeGenOpts.SampleProfileFile.empty()) {
-MPM.add(createPruneEHPass());
-MPM.add(createSampleProfileLoaderPass(CodeGenOpts.SampleProfileFile));
-  }
+  if (!CodeGenOpts.SampleProfileFile.empty())
+PMBuilder.PGOSampleUse = CodeGenOpts.SampleProfileFile;
 
   PMBuilder.populateFunctionPassManager(FPM);
   PMBuilder.populateModulePassManager(MPM);


Index: lib/CodeGen/BackendUtil.cpp
===
--- lib/CodeGen/BackendUtil.cpp
+++ lib/CodeGen/BackendUtil.cpp
@@ -464,10 +464,8 @@
   if (CodeGenOpts.hasProfileIRUse())
 PMBuilder.PGOInstrUse = CodeGenOpts.ProfileInstrumentUsePath;
 
-  if (!CodeGenOpts.SampleProfileFile.empty()) {
-MPM.add(createPruneEHPass());
-MPM.add(createSampleProfileLoaderPass(CodeGenOpts.SampleProfileFile));
-  }
+  if (!CodeGenOpts.SampleProfileFile.empty())
+PMBuilder.PGOSampleUse = CodeGenOpts.SampleProfileFile;
 
   PMBuilder.populateFunctionPassManager(FPM);
   PMBuilder.populateModulePassManager(MPM);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits