[llvm] [LV] Autovectorization for the all-in-one histogram intrinsic (PR #91458)

Paschalis Mpeis via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 05:34:31 PDT 2024


================
@@ -3127,6 +3160,99 @@ const LoopAccessInfo &LoopAccessInfoManager::getInfo(Loop &L) {
   return *I.first->second;
 }
 
+void AccessAnalysis::findHistograms(
+    StoreInst *HSt, SmallVectorImpl<HistogramInfo> &Histograms,
+    SmallPtrSetImpl<const Value *> &HistogramPtrs) {
+  LLVM_DEBUG(dbgs() << "LAA: Attempting to match histogram from " << *HSt
+                    << "\n");
+  // Store value must come from a Binary Operation.
+  Instruction *HPtrInstr = nullptr;
+  BinaryOperator *HBinOp = nullptr;
+  if (!match(HSt, m_Store(m_BinOp(HBinOp), m_Instruction(HPtrInstr)))) {
+    LLVM_DEBUG(dbgs() << "\tNo BinOp\n");
+    return;
+  }
+
+  // BinOp must be an Add or a Sub operating modifying the bucket value by a
----------------
paschalis-mpeis wrote:

nit: typo? perhaps meant just 'modifying the bucket value by .. '

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


More information about the llvm-commits mailing list