[llvm-commits] [llvm] r60344 - /llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Chris Lattner clattner at apple.com
Mon Dec 1 21:03:06 PST 2008


On Dec 1, 2008, at 12:32 AM, Bill Wendling wrote:

> Author: void
> Date: Mon Dec  1 02:32:40 2008
> New Revision: 60344
>
> URL: http://llvm.org/viewvc/llvm-project?rev=60344&view=rev
> Log:
> Generalize the FoldOrWithConstant method to fold for any two  
> constants which
> don't have overlapping bits.

Ah, thank you for generalizing this!

> /// FoldOrWithConstants - This helper function folds:
> ///
> +///     ((A | B) & 1) | (B & -2)
> ///
> /// into:
> ///
> +///     (A & 1) | B
> +///
> +/// The constants aren't important. Only that they don't overlap.  
> (I.e., the XOR
> +/// of the two constants is "all ones".)

I don't think this comment is correct, "1" and "4" don't overlap, but  
they don't xor to -1.

-Chris



More information about the llvm-commits mailing list