[llvm] [LV] Vectorize histogram operations (PR #99851)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 13:26:04 PDT 2024


================
@@ -8563,6 +8626,15 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
         Operands = {OpRange.begin(), OpRange.end()};
       }
 
+      // If this is a load instruction or a binop associated with a histogram,
+      // leave it until the store instruction to emit a combined intrinsic.
+      // Note that if the initial VF is scalar, we need to generate the normal
+      // clone recipe for these instructions. A histogram recipe will only be
+      // generated when minVF > 1.
+      if (Legal->getHistogramInfo(Instr) && !isa<StoreInst>(Instr) &&
----------------
fhahn wrote:

Would it be sufficient to leave to load around, to be cleaned up later by DCE?

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


More information about the llvm-commits mailing list