[PATCH][DAGCombiner] Distribute TRUNC through AND in rotation amount

Eric Christopher echristo at gmail.com
Thu Mar 6 09:25:49 PST 2014


On Thu, Mar 6, 2014 at 1:55 AM, Richard Sandiford
<rsandifo at linux.vnet.ibm.com> wrote:
> Adam Nemet <anemet at apple.com> writes:
>> This is already done for shifts.  Allow it for rotations as well. E.g.:
>>
>>    (rotl:i32 x, (trunc (and y, 31))) -> (rotl:i32 x, (and (trunc y), 31))
>>
>> Use the newly factored-out distributeTruncateThroughAnd.
>>
>> With this patch and some X86.td tweaks we should be able to remove redundant
>> masking of the rotation amount like in the example above.  HW implicitly
>> performs this masking.
>>
>> The testcase will be added as part of the X86 patch.
>
> LGTM FWIW (don't know whether that counts)
>

Your review works for me :)

-eric



More information about the llvm-commits mailing list