[PATCH] D15597: [ValueTracking] Handle opaque types in isDereferenceableAndAlignedPointer.

Artur Pilipenko via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 05:48:56 PST 2015


apilipenko added inline comments.

================
Comment at: lib/Analysis/ValueTracking.cpp:3302-3303
@@ -3301,3 +3301,4 @@
 
-    if (Offset.isNonNegative())
+    if (BV->getType()->getPointerElementType()->isSized() &&
+        Offset.isNonNegative())
       if (isDereferenceableFromAttribute(BV, Offset, Ty, DL, CtxI, DT, TLI) &&
----------------
mzolotukhin wrote:
> I updated the check to `isSized`.
> 
> I'm not well familiar with this code, so I don't have strong opinion on whether these checks are worth pulling in or not. It seems useful though.
I don't think that you have to sink isNonNegative check because it's checking a contract of stripAndAccumulateInBoundsConstantOffsets function. But it makes sense to sink isSized check to isDereferenceableFromAttribute.


http://reviews.llvm.org/D15597





More information about the llvm-commits mailing list