[PATCH] Add -fprofile-sample-use to Clang's driver.

Chandler Carruth chandlerc at gmail.com
Wed Oct 30 11:38:12 PDT 2013


  LGTM.


================
Comment at: lib/CodeGen/BackendUtil.cpp:247-248
@@ +246,4 @@
+  if (!CodeGenOpts.SampleProfileFile.empty())
+    PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
+                           addSampleProfileLoaderPass);
+
----------------
I wonder if EarlyAsPossible is quite right.

For example, it might be useful for LowerExpect to run first in order for the branch weights from __builtin_expect to be visible when reading the profile. Thoughts? (Clearly not a blocker for this patch, just something to think about.)


http://llvm-reviews.chandlerc.com/D2066



More information about the cfe-commits mailing list