[PATCH] D19276: folding compares if pointers do not escape

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 17:16:53 PDT 2016


reames added inline comments.

================
Comment at: test/Transforms/InstCombine/compared-unescaped.ll:35
@@ +34,3 @@
+  %lgp = load i32*, i32** @gp, align 8
+  %cmp = icmp eq i32* %bc, %lgp
+  %rt = zext i1 %cmp to i32
----------------
This test case is a great example of what I mentioned to you on the phone the other day.  Regardless of whether we can elide the call to malloc, we should be able to fold this comparison to false.  

To be clear, I am not suggesting you change the current change (LGTM as well).  This would be useful future work though.  


http://reviews.llvm.org/D19276





More information about the llvm-commits mailing list