[PATCH] Move memset value into register

Chandler Carruth chandlerc at google.com
Mon Sep 16 14:55:44 PDT 2013


I wonder whether this is the best approach.

Specifically, this is trading off register pressure for code size. I think
it is probably the correct call in many cases, but perhaps not in all
cases. Also, it has nothing to do with memset, and everything to do with
any sequence of immediate operand movs.

I think this would be done somewhat better as an MI peephole that takes
into account register pressure and how many mov instructions share the
immediate to tradeoff the register pressure and potential instructions to
materialize the constant into a register against the shrink of immediate
operand movs.

But yes, Nadav or Andy would have more insights here...


On Mon, Sep 16, 2013 at 10:00 AM, Serge Pavlov <sepavloff at gmail.com> wrote:

> Friendly ping.
>
>
> 2013/9/10 Serge Pavlov <sepavloff at gmail.com>
>
>>   Cosmetical update to the patch
>>   If block size is small, the size of largest move chunk may be smaller
>> than the
>>   natural register width and target may not have resisters of such width.
>> Example
>>   is 32-bit target that does not have 16-bit registers. Avoid allocation
>> such
>>   illegal registers.
>>
>> Hi bkramer, nadav,
>>
>> http://llvm-reviews.chandlerc.com/D1484
>>
>> CHANGE SINCE LAST DIFF
>>   http://llvm-reviews.chandlerc.com/D1484?vs=3692&id=4161#toc
>>
>> Files:
>>   include/llvm/Target/TargetLowering.h
>>   lib/CodeGen/SelectionDAG/SelectionDAG.cpp
>>   lib/Target/X86/X86ISelLowering.cpp
>>   lib/Target/X86/X86ISelLowering.h
>>   test/CodeGen/X86/memset-sse-stack-realignment.ll
>>   test/CodeGen/X86/memset.ll
>>   test/CodeGen/X86/tlv-1.ll
>>
>
>
>
> --
> Thanks,
> --Serge
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130916/f50cb1a6/attachment.html>


More information about the llvm-commits mailing list