> @@ -2443,10 +2443,9 @@
>    // Check to see if this is an unsigned division with an exact  
> power of 2,
>    // if so, convert to a right shift.
>    if (ConstantInt *C = dyn_cast<ConstantInt>(Op1)) {
> -    APInt Val(C->getValue());
> -    if (Val != 0 && Val.isPowerOf2())    // Don't break X / 0
> +    if (!C->isZero() && C->getValue().isPowerOf2())  // Don't  
> break X / 0

Zero isn't a power of two, you should be able to drop the isZero check.

Thanks.  BTW, nice work on instcombine!

-Chris

_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to