[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:11:18 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:
> 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.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1288
   bool isUniformAfterVectorization(Instruction *I, ElementCount VF) const {
+    // Pseudo probe needs to be run for each lane.
+    if (isa<PseudoProbeInst>(I))
----------------
wenlei wrote:
> Perhaps augment the comment to be more explicit about why we need to duplicate probes:
> 
> > We want pseudo-probe to be duplicated for each unrolled iteration, so profiled loop trip count can be accurately accumulated instead of being under counted. 
Sounds good.


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