[PATCH] D21568: Invoke simplifycfg and sroa before instcombine.

Diego Novillo via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 04:55:47 PDT 2016


dnovillo added inline comments.

================
Comment at: lib/CodeGen/BackendUtil.cpp:181
@@ -180,3 +180,3 @@
 
-static void addInstructionCombiningPass(const PassManagerBuilder &Builder,
-                                        legacy::PassManagerBase &PM) {
+static void addInstructionCombiningPassBeforeSampleProfiler(
+    const PassManagerBuilder &Builder, legacy::PassManagerBase &PM) {
----------------
This is becoming much more than adding instcombine.  Perhaps something like addCleanupPassesForSampleProfiler?

================
Comment at: lib/CodeGen/BackendUtil.cpp:184
@@ +183,3 @@
+  // instcombine is needed before sample profile annotation because it converts
+  // certain function calls to be inlinable. simplifycfg and sroa is needed
+  // before instcombine for necessary preparation.
----------------
s/is needed/are needed/

What is this necessary preparation that they're needed for?  In these descriptions, brevity is our enemy :)  If you could write down more context here, that would be great.  Thanks!

================
Comment at: test/CodeGen/pgo-sample.c:1
@@ -1,2 +1,2 @@
 // Test if PGO sample use passes are invoked.
 //
----------------
So, for this test case, it's fine that we are showing that the passes are being run.  But, is there a test case where we can test that the cleanup passes do something actually useful?

Perhaps an IL test that shows the transformations you're after.


http://reviews.llvm.org/D21568





More information about the llvm-commits mailing list