[PATCH] [SLSR] consider &B[S << i] as &B[(1 << i) * S]

Sanjoy Das sanjoy at playingwithpointers.com
Mon Apr 6 00:16:06 PDT 2015


Please disregard my last comment on the `nsw` bit.  I checked, the langref defines `nsw` in terms of the multiplication that would be equivalent to the shift, and your code is correct as it is.

In case you're curious, I was going by the following definition of sign-overflow -- A OP B sign-overflows if "sext(A) OP sext(B) != sext(A OP B)".  That definition does not really make sense in the context of left shifts.


http://reviews.llvm.org/D8837

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






More information about the llvm-commits mailing list