[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

Eric Christopher via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 9 13:08:04 PDT 2020


echristo added a comment.

Some inline nits. I see you've already committed and that's fine - I still don't think we should do it, but we can delete it again soon :)



================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:623
   PMBuilder.LoopVectorize = CodeGenOpts.VectorizeLoop;
+  PMBuilder.CallGraphProfile = !CodeGenOpts.DisableIntegratedAS;
 
----------------
Comment here as to why.


================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:1148
   PTO.SLPVectorization = CodeGenOpts.VectorizeSLP;
-  PTO.CallGraphProfile = CodeGenOpts.CallGraphProfile;
+  PTO.CallGraphProfile = !CodeGenOpts.DisableIntegratedAS;
   PTO.Coroutines = LangOpts.Coroutines;
----------------
Comment here as to why.


================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:1566
   Conf.PTO.SLPVectorization = CGOpts.VectorizeSLP;
-  Conf.PTO.CallGraphProfile = CGOpts.CallGraphProfile;
+  Conf.PTO.CallGraphProfile = !CGOpts.DisableIntegratedAS;
 
----------------
Ditto :)


================
Comment at: llvm/lib/Transforms/Instrumentation/CGProfile.cpp:64
   // Ignore error here.  Indirect calls are ignored if this fails.
-  (void)(bool)Symtab.create(M);
+  (void)(bool) Symtab.create(M);
   for (auto &F : M) {
----------------
Extra space? Did clang-format put this in?


================
Comment at: llvm/lib/Transforms/Instrumentation/CGProfile.cpp:66
   for (auto &F : M) {
-    if (F.isDeclaration())
+    if (F.isDeclaration() || !F.getEntryCount())
       continue;
----------------
Comment? What's the change for?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83013/new/

https://reviews.llvm.org/D83013





More information about the cfe-commits mailing list