[PATCH][Loop Vectorizer] Identify basic FP recurrences in LoopVectorizer

Arnold Schwaighofer aschwaighofer at apple.com
Mon Jun 15 13:13:11 PDT 2015


+  // We start with the PHI node and scan for all of the users of this
+  // instruction. All users must be instructions that can be used as recurrence
+  // variables (such as ADD). We must have a single out-of-block user.

Leftover from AddRecductionVar. This is not true for recurrences as you later mention.


+  // 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