[PATCH] Teach ComputeNumSignBits about signed divisions

Nadav Rotem nrotem at apple.com
Tue Mar 3 09:42:45 PST 2015


> On Mar 3, 2015, at 12:55 AM, Sanjoy Das <sanjoy at playingwithpointers.com> wrote:
> 
> REPOSITORY
>  rL LLVM
> 
> ================
> Comment at: lib/Analysis/ValueTracking.cpp:1732
> @@ +1731,3 @@
> +
> +      // Ignore non-positivie denominator.
> +      if (!Denominator->isStrictlyPositive())
> ----------------
> Nit: "non-positiveā€

Okay. 

> 
> ================
> Comment at: lib/Analysis/ValueTracking.cpp:1733
> @@ +1732,3 @@
> +      // Ignore non-positivie denominator.
> +      if (!Denominator->isStrictlyPositive())
> +        break;
> ----------------
> Why not do this check before the call to `ComputeNumSignBits`?  Then we'll bail out earlier without doing unnecessary work.

Good point. 
 
> 
> http://reviews.llvm.org/D8028
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 





More information about the llvm-commits mailing list