[cfe-dev] Why no NSW/NUW with SHL instruction?

Reid Kleckner rnk at google.com
Wed Nov 19 10:52:56 PST 2014

What is the difference between logical and arithmetic left shift on your
target? LLVM only makes that distinction for right shift, and not for left

On Wed, Nov 19, 2014 at 10:32 AM, Ryan Taylor <ryta1203 at gmail.com> wrote:

> I'm curious why there is not always a nsw/nuw flag with shl instruction?
> For example, I have a signed int I'm shifting left (want to generate an
> arithmetic left shift in backend for signed int shift lefts and logical for
> unsigned, at the moment).... but shl on a signed int does not always have
> nsw/nuw flag present, why is this?
> Thank you.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141119/03ced874/attachment.html>

More information about the cfe-dev mailing list