[PATCH] D24729: Don't look through addrspacecast in GetPointerBaseWithConstantOffset

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 09:38:41 PDT 2016


reames added inline comments.

================
Comment at: lib/Analysis/ValueTracking.cpp:2845
@@ -2845,1 +2844,3 @@
+      // NOTE: Looking through a addrspacecast is not legal here since it would
+      // change address spaces (and thus possibly pointer sizes)
       Ptr = cast<Operator>(Ptr)->getOperand(0);
----------------
For consistency, you should also change getUnderlyingObject at the same time.

================
Comment at: test/Transforms/GVN/PRE/rle.ll:321
@@ -320,3 +320,1 @@
 
-define i8 @coerce_offset0_addrspacecast(i32 %V, i32* %P) {
-  store i32 %V, i32* %P
----------------
Hm, loosing this optimization seems unfortunate.  Any chance we can peak through addrspace casts only when the two pointer sizes are equal?


https://reviews.llvm.org/D24729





More information about the llvm-commits mailing list