[PATCH] Teach BaseIndexOffset::match to identify base pointers in loops
Juergen Ributzka
juergen at apple.com
Thu Aug 29 10:27:07 PDT 2013
Thanks for the warm welcome - although it wasn’t my first patch ;-)
Cheers,
Juergen
On Aug 28, 2013, at 3:46 PM, Eric Christopher <echristo at gmail.com> wrote:
> Sweet, thanks.
>
> Great first patch.
>
> -eric
>
> On Wed, Aug 28, 2013 at 3:37 PM, Juergen Ributzka <juergen at apple.com> wrote:
>> Yup, it was already committed in r188936. I fixed the style in r189526 as
>> you suggested.
>>
>> Thanks
>>
>> -Juergen
>>
>>
>> On Aug 28, 2013, at 3:20 PM, Eric Christopher <echristo at gmail.com> wrote:
>>
>> Haven't looked to see if it was ever committed (it also LGTM and
>> awesome for the better comments), one style nit:
>>
>> + if (Ptr->getOperand(1)->getOpcode() == ISD::MUL) {
>> + return BaseIndexOffset(Ptr, SDValue(), 0, IsIndexSignExt);
>> + }
>>
>> No need for braces here I don't think.
>>
>> -eric
>>
>>
>> On Wed, Aug 21, 2013 at 2:44 PM, Juergen Ributzka <juergen at apple.com> wrote:
>>
>> Hi @ll,
>>
>> the small utility function that pattern matches Base + Index + Offset
>> patterns for loads and stores fails to recognize the base pointer for
>> loads/stores from/into an array at offset 0 inside a loop. As a result
>> DAGCombiner::MergeConsecutiveStores was not able to merge all stores.
>>
>> Example:
>> for(int i=0; i <N; i+=4) {
>> a[i+0] = 1;
>> a[i+1] = 1;
>> a[i+2] = 1;
>> a[i+3] = 1;
>> }
>>
>> In this example BaseIndexOffset::match would identify a different base
>> pointer for a[i+0] then for all the others.
>>
>> This small patch adds an additional pattern match to recognize this special
>> case and a test case.
>>
>> Cheers,
>> Juergen
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
More information about the llvm-commits
mailing list