[llvm-commits] [llvm] r53271 - in /llvm/trunk: lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/2008-07-08-SubAnd.ll
Nick Lewycky
nicholas at mxc.ca
Wed Jul 9 22:52:59 PDT 2008
Duncan Sands wrote:
> Hi Nick,
>
>> + // (A - N) & AndRHS -> -N & AndRHS where A & AndRHS == 0
>
> this seems to be wrong for A = 5, N = 1, AndRHS = 2.
Thanks Duncan. The fix I used was to replace 'where A & AndRHS' with
'where A & Mask' such that Mask = all 1's starting with the first 1 bit
in AndRHS. That way AndRHS=2 causes Mask=3 and A&Mask = 1.
Nick
More information about the llvm-commits
mailing list