[PATCH] D144066: [Pseudo probe] Duplicate probes in vectorized loop body.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 09:54:43 PST 2023


hoy added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1287
   /// Returns true if \p I is known to be uniform after vectorization.
   bool isUniformAfterVectorization(Instruction *I, ElementCount VF) const {
+    // Pseudo probe needs to be run for each lane.
----------------
wenlei wrote:
> hoy wrote:
> > wenlei wrote:
> > > Will a non-uniform instruction in loop hinder vectorization? 
> > It doesn't. When it gets here, pseudo probes already passed legality checks. In the regression test, the loop can be vectorized with probes duplicated.
> How does this affect cost-benefit analysis? I saw it's used in `LoopVectorizationCostModel::getInstructionCost`.
Pseudo probes and debug instructions are excluded from legality and cost analysis. E.g,

https://github.com/llvm/llvm-project/blob/8fd5558b29761aec91143129cb23c90581a944e9/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp#L6292


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144066



More information about the llvm-commits mailing list