r289715 - Create SampleProfileLoader pass in llvm instead of clang

Dehao Chen via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 14 13:41:05 PST 2016


Author: dehao
Date: Wed Dec 14 15:41:04 2016
New Revision: 289715

URL: http://llvm.org/viewvc/llvm-project?rev=289715&view=rev
Log:
Create SampleProfileLoader pass in llvm instead of clang

Summary:
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.

Reviewers: tejohnson, davidxl, dnovillo

Subscribers: mehdi_amini, cfe-commits

Differential Revision: https://reviews.llvm.org/D27744

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=289715&r1=289714&r2=289715&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Wed Dec 14 15:41:04 2016
@@ -464,10 +464,8 @@ void EmitAssemblyHelper::CreatePasses(le
   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);




More information about the cfe-commits mailing list