Revert "Treat sret arguments as being dereferenceable in getPointerDereferenceableByt...
authorBjorn Steinbrink <bsteinbr@gmail.com>
Sun, 17 Dec 2017 15:16:51 +0000 (15:16 +0000)
committerBjorn Steinbrink <bsteinbr@gmail.com>
Sun, 17 Dec 2017 15:16:51 +0000 (15:16 +0000)
This reverts commit 8b7a7660a3904b2088bc594311bcea2c651def08.

I didn't mean to commit this.

llvm-svn: 320944

llvm/lib/IR/Value.cpp

index d36b7cd..eae697b 100644 (file)
@@ -627,10 +627,9 @@ uint64_t Value::getPointerDereferenceableBytes(const DataLayout &DL,
   CanBeNull = false;
   if (const Argument *A = dyn_cast<Argument>(this)) {
     DerefBytes = A->getDereferenceableBytes();
-    if (DerefBytes == 0 && (A->hasByValAttr() || A->hasStructRetAttr())) {
+    if (DerefBytes == 0 && A->hasByValAttr()) {
       Type *PT = cast<PointerType>(A->getType())->getElementType();
-      if (PT->isSized())
-        DerefBytes = DL.getTypeStoreSize(PT);
+      DerefBytes = DL.getTypeStoreSize(PT);
     }
     if (DerefBytes == 0) {
       DerefBytes = A->getDereferenceableOrNullBytes();