[llvm] [IR] Add nowrap flags for trunc instruction (PR #85592)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 24 01:56:43 PDT 2024


================
@@ -11318,6 +11321,14 @@ and converts the remaining bits to ``ty2``. Since the source size must
 be larger than the destination size, ``trunc`` cannot be a *no-op cast*.
 It will always truncate bits.
 
+``nuw`` and ``nsw`` stand for "No Unsigned Wrap" and "No Signed Wrap",
+respectively. If the ``nuw`` and/or ``nsw`` keywords are present, the
+result value of the ``trunc`` is a :ref:`poison value <poisonvalues>`.
+``nuw``  results a :ref:`poison value <poisonvalues>` if any of the
----------------
dtcxzyw wrote:

```suggestion
``nuw`` results a :ref:`poison value <poisonvalues>` if any of the
```

https://github.com/llvm/llvm-project/pull/85592


More information about the llvm-commits mailing list