From 00eb18da3b9e87bad38aaba31bd299cb8850b845 Mon Sep 17 00:00:00 2001 From: Sanjoy Das Date: Sun, 13 Nov 2016 23:40:40 +0000 Subject: [PATCH] [LangRef] Drop misleading anecdote `shl nsw i8 1, i8 8` is poison, but `mul i8 1, i8 128` is not. This was discussed previously here: http://lists.llvm.org/pipermail/llvm-dev/2015-April/084195.html. From the discussion, it was not clear which semantics we want for `shl`, but for now at least make the language reference more accurate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286785 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/LangRef.rst b/docs/LangRef.rst index f20f4385c2f..c5f927d92ef 100644 --- a/docs/LangRef.rst +++ b/docs/LangRef.rst @@ -6430,9 +6430,7 @@ If the ``nuw`` keyword is present, then the shift produces a :ref:`poison value ` if it shifts out any non-zero bits. If the ``nsw`` keyword is present, then the shift produces a :ref:`poison value ` if it shifts out any bits that disagree with the -resultant sign bit. As such, NUW/NSW have the same semantics as they -would if the shift were expressed as a mul instruction with the same -nsw/nuw bits in (mul %op1, (shl 1, %op2)). +resultant sign bit. Example: """""""" -- 2.50.1