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

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 19:12:42 PST 2023


wenlei 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.
----------------
Will a non-uniform instruction in loop hinder vectorization? 


================
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))
----------------
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. 


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