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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 04:09:07 PDT 2024


================
@@ -11318,6 +11321,13 @@ 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 ``add`` is a :ref:`poison value <poisonvalues>` if
+any of the truncated bits are non-zero and/or any of the truncated bits
+are not the same as the top bit of the truncation result,respectively,
+occurs.
----------------
nikic wrote:

I'd split nuw/nsw off into two separate sentences rather than trying to combine them with "respectively".

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


More information about the llvm-commits mailing list