[PATCH][Loop Vectorizer] Identify basic FP recurrences in LoopVectorizer
Arnold Schwaighofer
aschwaighofer at apple.com
Tue Jul 7 12:37:32 PDT 2015
LGTM.
> On Jun 17, 2015, at 10:37 AM, Tyler Nowicki <tnowicki at apple.com> wrote:
>
> Hi Arnold,
>
> It might be possible to combine both methods. Soon I’ll be extending AddBasicRecurrenceVar() to identify other uses of a recurrence, such as a store. I’ll try to combine them after that.
>
> This is better?
>
> // A value in the basic recurrence can be used:
> // - By the recurrence:
> // - Recurrence operation:
> // - One use of recurrence value (safe).
> // - Multiple use of recurrence value (not safe).
> // - PHI:
> // - All uses of the PHI must be the recurrence (safe).
> // - Otherwise, not safe.
> // - By out-of-loop instructions (not safe).
> // - By non-recurrence instructions in the loop:
> // - Multiple uses by reductions (safe).
> // - Otherwise, not safe.
> // This is either:
> // * An instruction type other than PHI or the recurrence operation.
> // * A PHI in the header other than the initial PHI.
>
> Thanks for the review!
>
> Tyler
>
>> + // A value in the simple recurrence can be used:
>> + // - By the recurrence:
>> + // - Recurrence operation:
>> + // - One use of recurrence value (safe).
>> + // - Multiple use of recurrence value (not safe).
>> + // - PHI:
>> + // - All uses of the PHI must be the recurrence (safe).
>> + // - Otherwise, not safe.
>> + // - By any instructions outside of the loop (not safe).
>>
>> Here.
>>
>> + // - By an instruction that is not part of the recurrence:
>> + // - Multiple uses by reductions (safe).
>> + // - Multiple uses by stores (safe).
>> + // - Otherwise, not safe.
>> + // This is either:
>> + // * An instruction type other than PHI or the reduction operation.
>> + // * A PHI in the header other than the initial PHI.
>>
>>
>> We should be able to refactor AddReductionVar and AddBasicRecurrenceVar into a common utility? They are largely identical.
>>
>> Other than that this LGTM.
>>
>>
>>> On Jun 13, 2015, at 6:59 PM, Tyler Nowicki <tnowicki at apple.com> wrote:
>>>
>>> Hi,
>>>
>>> I would appreciate a review of this patch. It builds off a couple of other patches that are also in review.
>>>
>>> Thanks,
>>>
>>> Tyler
>>>
>>>> On Jun 3, 2015, at 6:29 PM, Tyler Nowicki <tnowicki at apple.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> This patch builds on the refactoring patches in "[PATCH][VECTORIZER] Refactor ReductionDescriptor to also support floating-point recurrences".
>>>>
>>>> The patch identifies basic floating-point recurrences and emits diagnostic remarks when a recurrence is found. Tests in the patch look for the diagnostic messages to verify the recurrences were found.
>>>>
>>>> Subsequent patches will make the loop vectorizer generate code for the basic recurrences. Basic recurrences are a lot like the basic reductions that are already identified and vectorized.
>>>>
>>>> Thanks,
>>>>
>>>> Tyler
>>>>
>>>> <0003-Identify-Basic-FP-Recurrences-In-Loop-Vectorizer.patch>
>>>
>>> _______________________________________________
>>> 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