[PATCH] [IR] Fix the definition of 'shl nsw'

David Majnemer david.majnemer at gmail.com
Tue Apr 7 22:26:14 PDT 2015


In http://reviews.llvm.org/D8890#153095, @sanjoy wrote:

> Just to be clear, you're explicitly making `shl nsw X Y` be poison less often than `mul nsw X (1<<Y)`?  The example I have in mind is (for i8) `X` = `-1`, `Y` = `7`.  If so, that might be worth stating in the LangRef, maybe even with an example or two.


Er, the idea is that they will be poison at exactly the same rate.  `mul nsw i8 -1, 128` is poison because `128` can't be represented in i8.  `shl nsw i8 -1, 7` should be poison as well.  I see the typo you are getting at, "it shifts out any non-sign bits" is wrong.  I'll try to rephrase it so it is correct.


http://reviews.llvm.org/D8890

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list