[PATCH] [SCCP] Calculate Null Pointer Comparisons

Philip Reames listmail at philipreames.com
Fri May 15 10:34:23 PDT 2015


To my knowledge, post-dominance information is not currently used within LLVM's existing passes.  As a result, you'd need to justify the cost of the post-dom-tree computation.

I strongly request that you implement the trivial post dominance case (i.e. in same basic block as per the linked patch) to start with.  If you then want to propose using post-dominance information more widely, I'm open to that discussion.  I just don't want to couple of the optimization at hand with a broader (and harder to justify) discussion.

Once the optimizations in, we could either enhance it by pursuing the post-dominance information or by using the replaceDominatesUses mechanism from GVN and (soon) EarlyCSE.

p.s. You haven't updated any of the existing transforms to keep the post dominance info up to date.  As a result, the code as currently structured is really, really wrong.

p.p.s. Your description mentions icmps.  I don't get why you're making the restriction.  Regardless of the source, you know the value of the Value.  Your actual code doesn't seem to have this restriction.


================
Comment at: lib/Transforms/Scalar/SampleProfile.cpp:100
@@ -99,3 +99,3 @@
     AU.addRequired<DominatorTreeWrapperPass>();
-    AU.addRequired<PostDominatorTree>();
+    AU.addRequired<PostDominatorTreePass>();
   }
----------------
I think you've mixed patches here?

http://reviews.llvm.org/D9634

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list