[PATCH] D115274: [IR][RFC] Memory region declaration intrinsic

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 10 01:14:44 PST 2021


courbet added inline comments.


================
Comment at: llvm/docs/LangRef.rst:20430-20433
+Note that the ``begin_offset`` is non-positive (``begin_offset s<= 0``)
+and ``end_offset`` is non-negative (``end_offset s>= 0``) by definition,
+otherwise the ``ptr`` lies outside of declared memory region,
+and the returned pointer is a :ref:`poison value <poisonvalues>`.
----------------
I'm still confused as to why we need that restriction.

For example, why do we want to disallow the following:

```
  %p2 = getelementptr inbounds i32, i32* %p1, i64 -42
  %p2_bounded = @llvm.memory.region.decl.p0i8(%p2, 42, 43)
  %p3 = getelementptr inbounds i32, i32* %p2_bounded, i64 42
  %v = load i32, i32* %p3, align 4
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115274/new/

https://reviews.llvm.org/D115274



More information about the llvm-commits mailing list