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

Chandler Carruth chandlerc at gmail.com
Wed Apr 8 00:02:59 PDT 2015


In http://reviews.llvm.org/D8890#153137, @majnemer wrote:

> In http://reviews.llvm.org/D8890#153126, @chandlerc wrote:
>
> > FWIW, I really liked having a definition explicit in terms of what kinds of bits can be shifted out. I think its good to *both* define this from first principles of where bits move in the shift operation, *and* how it should relate to an NSW multiply by a power of two.
> >
> > Unsure when after when we chatted this wording went away, but I'd really like to keep it.
>
>
> The explicit definition gets hairy very quickly.  It didn't correctly handle `shl nsw i32 1073741824, 1` or `shl nsw i32 -1, 31`.


The version we looked at we specifically had handle -1. I don't think it is hard to make it handle (1 << 30).


http://reviews.llvm.org/D8890

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






More information about the llvm-commits mailing list