[PATCH] [SCCP] Calculate Null Pointer Comparisons

Philip Reames listmail at philipreames.com
Wed May 13 15:28:25 PDT 2015


Please provide a real description of the change.  You'll need a submission comment eventually, please write that and add it to the review.  Also, please update the title.  This is not specific to null checks.


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4626
@@ +4625,3 @@
+              Value *Const = ConstantInt::get(Cond->getType(), PickFirst);
+              Cond->replaceAllUsesWith(Const);
+              RecursivelyDeleteTriviallyDeadInstructions(Cond);
----------------
This is wrong since the condition may not be in the same basic block as the branch we're reasoning about.  You can replace dominated uses, but not all uses.  

You might find these changes interesting:
http://reviews.llvm.org/D9312 - this ones directly analogous in JumpThreading.
http://reviews.llvm.org/D9763 - this prunes a lot of easy cases earlier in the pipeline, possibly removing a bunch of pass ordering problems

http://reviews.llvm.org/D9634

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






More information about the llvm-commits mailing list