[llvm-branch-commits] [llvm] [LoopVectorize] Support vectorization of compressing patterns (PR #214491)

Andrei Elovikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 14 09:05:01 PDT 2026


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

I'm worried about doing something like `store %monotonic, %uni + (%iv / 1024)`. If/when we deduce the pointer operand as uniform, the uniformity check for the monotonic idiom would become very fragile/implicit/unclear.

https://github.com/llvm/llvm-project/pull/214491


More information about the llvm-branch-commits mailing list