[PATCH][VECTORIZER] Refactor ReductionDescriptor to also support floating-point recurrences

Tyler Nowicki tnowicki at apple.com
Wed Jun 3 13:56:16 PDT 2015


Hi Hal,

Thanks for the review.

I’ve made the changes you asked for. Here are the patches. Soon I’ll start another thread for a patch builds on these to identify basic recurrences that are not reductions.

Thanks,

Tyler


> On Jun 1, 2015, at 5:55 AM, Hal Finkel <hfinkel at anl.gov> wrote:
> 
> Hi Tyler,
> 
> Most of this patch seems to be renaming reduction -> recurrence, but there are some extra changes. I don't object to changing the name, a reduction (in our sense) is a special case of a recurrence relation, and I'd certainly like to see the more-general case handled, however:
> 
> 1. Please provide one patch which just changes the name, and a second patch with the other changes
> 
> 2. Please add in a comment somewhere (maybe near the definition of RecurrenceInstDesc) that reductions are a special case of the recurrences with the name change. That way someone looking for the word 'reduction' will find it and can easily figure out what is going on.
> 
> -Hal
> 
> ----- Original Message -----
>> From: "Tyler Nowicki" <tnowicki at apple.com <mailto:tnowicki at apple.com>>
>> To: llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>> Sent: Thursday, May 28, 2015 8:35:08 PM
>> Subject: [PATCH][VECTORIZER] Refactor ReductionDescriptor to also support	floating-point recurrences
>> 
>> 
>> 
>> Hello,
>> 
>> Here is a patch refactoring ReductionDescriptor used by the loop
>> vectorizer. Currently we cannot vectorize loops with floating-point
>> recurrences that are not reductions. For example:
>> 
>> double s = 0.0, v = 0.0;
>> for(int i = 0; i < n; i++) {
>> v = v + 1.5;
>> s = s + v;
>> }
>> return s;
>> 
>> ’s' is a reduction, but the vectorizer cannot identify ‘v' as a
>> reduction so it fails.
>> 
>> My plan is to vectorize these loops by including methods for
>> identifying floating-point recurrences and creating a
>> RecurrenceDescriptor for each that will be used to generate
>> vectorized code in the loop vectorizer.
>> 
>> Any comments or suggestions on this plan would be appreciated.
>> 
>> Tyler
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits <http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
>> 
> 
> -- 
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150603/f9114a9e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Renamed-reduction-structures-to-recurrence-structure.patch
Type: application/octet-stream
Size: 29047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150603/f9114a9e/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150603/f9114a9e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Moved-RecurrenceInstDesc-into-RecurrenceDescriptor.patch
Type: application/octet-stream
Size: 15282 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150603/f9114a9e/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150603/f9114a9e/attachment-0002.html>


More information about the llvm-commits mailing list