Ping 2: [PATCH] DAGCombiner: Recognise rotates by X+C

Richard Sandiford rsandifo at linux.vnet.ibm.com
Thu Dec 19 09:28:51 PST 2013


Second ping for this patch.

Richard Sandiford <rsandifo at linux.vnet.ibm.com> writes:
> The SystemZ tests check for rotates by X+10 using:
>
>    %add = add i32 %amt, 10
>    %sub = sub i32 32, %add
>    %parta = shl i32 %a, %add
>    %partb = lshr i32 %a, %sub
>    %or = or i32 %parta, %partb
>
> But instcombine turns this into:
>
>    %add = add i32 %amt, 10
>    %sub = sub i32 22, %amt
>    %parta = shl i32 %a, %add
>    %partb = lshr i32 %a, %sub
>    %or = or i32 %parta, %partb
>
> so that the subtraction isn't dependent on the addition.  This patch extends DAGCombiner to handle this pattern too.
>
>
> http://llvm-reviews.chandlerc.com/D2347
>
> Files:
>   lib/CodeGen/SelectionDAG/DAGCombiner.cpp
>   test/CodeGen/SystemZ/shift-04.ll

Thanks,
Richard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2347.1.patch
Type: text/x-patch
Size: 5039 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131219/9edcd230/attachment.bin>


More information about the llvm-commits mailing list