[PATCH] D18066: Add some shortcuts in Value Propagation for alloca

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 16:08:26 PDT 2016


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

Sorry for being unresponsive for so long.  This has reached the top of my queue again.

I'm still not entirely happy with this patch, mostly because I don't feel I understand *why* it makes such a huge difference, but I've also held this up for much too long.  This is a reasonable approach to a real problem and we can iterate in tree if needed.

LGTM.


================
Comment at: lib/Analysis/LazyValueInfo.cpp:1380
@@ -1379,1 +1379,3 @@
 
+static bool isKnownNonConstant(Value *V) {
+  V = V->stripPointerCasts();
----------------
Add
/// Returns true if we can statically tell that this value will never be a "useful" constant.  In practice, this means we've got something like an alloca or a malloc call for which a comparison against a constant can only be guarding dead code.  Note that we are potentially giving up some precision here (a constant result) in favour of avoiding a expensive search for a easily answered common query.


Repository:
  rL LLVM

https://reviews.llvm.org/D18066





More information about the llvm-commits mailing list