================
@@ -2903,6 +2920,38 @@ void 
LoopVectorizationCostModel::collectLoopUniforms(ElementCount VF) {
     AddToWorklistIfAllowed(IndUpdate);
   }
 
+  // Handle monotonic phis (similarly to induction vars).
+  for (const auto &MonotonicPHI : Legal->getMonotonicPHIs()) {
----------------
MacDue wrote:

This is more done for the negative cases than the positive as this patch does 
not support non-uniform uses of any `MonotonicPHI`. The `MonotonicDescriptor` 
currently just looks for the simple monotonic IV pattern, but not necessarily 
how it's used.

I'm not sure exactly what the changes would look like to the descriptor yet, 
but I think `collectLoopUniforms` is a fairly sensible place to check it as it 
reuses some of the existing uniformity checks. I'd push back a little on the 
recurrence descriptor being a 'good' example, as it's really quite complex and 
hard to follow.  

https://github.com/llvm/llvm-project/pull/214491
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to