[PATCH] D28549: Global DCE performance improvement

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 10:51:50 PST 2017


davide added a comment.

Can you please add a comment in the code explaining how the new algorithm works? I'd like to see figures on a case where this actually matters (e.g. take  the bitcode, run through opt -globaldce -time-passes with the old/new algorithm and see what's the performance difference)



================
Comment at: lib/Transforms/IPO/GlobalDCE.cpp:173
 
+  // compute direct dependencies of ifuncs
   for (GlobalIFunc &GIF : M.ifuncs()) {
----------------
Capital letter, ending with a dot (here and everywhere else).


================
Comment at: lib/Transforms/IPO/GlobalDCE.cpp:185
+  SmallVector<GlobalValue*, 8> NewLiveGVs{AliveGlobals.begin(), AliveGlobals.end()};
+  while(!NewLiveGVs.empty()) {
+    auto * LGV = NewLiveGVs.pop_back_val();
----------------
This whole patch needs to be clang-formatted, this should look like 
`while (blah)`.


================
Comment at: lib/Transforms/IPO/GlobalDCE.cpp:234
 
+
   // Now that all interferences have been dropped, delete the actual objects
----------------
stray newline.


Repository:
  rL LLVM

https://reviews.llvm.org/D28549





More information about the llvm-commits mailing list