[PATCH] D48239: [LangRef] Clarify meaning of "dereferencable" attribute/metadata.

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 16 12:25:34 PDT 2018


sanjoy added inline comments.


================
Comment at: docs/LangRef.rst:1133
+    returned value is dereferenceable for the duration of the program.
+    If the pointer cannot be dereferenced, the behavior is undefined. This
     attribute may only be applied to pointer typed parameters. A pointer that
----------------
DeadArgElim transforms

```
define void @f(i8* dereferenceable(16) %ptr) {
  ret void
}

define void @caller(i8* %v) {
  call void @f(i8* %v)
  ret void
}
```

to

```
define void @f(i8* dereferenceable(16) %ptr) {
  ret void
}

define void @caller(i8* %v) {
  call void @f(i8* undef)
  ret void
}
```

Given this semantic this transform is wrong, right?


Repository:
  rL LLVM

https://reviews.llvm.org/D48239





More information about the llvm-commits mailing list