[PATCH] D151658: [LV] Check if value was already not uniform for previous VF.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 03:29:56 PDT 2023


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4684
+        return false;
+    }
     if (!Legal->isUniformMemOp(*I))
----------------
Ayal wrote:
> This looks right.
> Also holds for non-MemOpUse?
> Furthermore, if value is uniform for PrevVF, suffice to only check if SCEVs of lanes 0 and VF-1 are equal.
> Also holds for non-MemOpUse?

Yes, but the loop that uses `isUniformMemOpUse` also collects pointers where only lane 0 is demanded (for widened memory ops), so checking in the loop directly isn't possible without first dis-entangling this logic.


> Furthermore, if value is uniform for PrevVF, suffice to only check if SCEVs of lanes 0 and VF-1 are equal.

Hmm, I think we would have to check if lane 0 matches the lanes PrevVF..VF-1? Might be good as follow-up, as it will require adjusting the API a bit I think to provide the additional info.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151658/new/

https://reviews.llvm.org/D151658



More information about the llvm-commits mailing list