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

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 06:39:16 PDT 2024


================
@@ -1966,6 +1987,15 @@ getDependenceDistanceStrideAndSize(
       BPtr->getType()->getPointerAddressSpace())
     return MemoryDepChecker::Dependence::Unknown;
 
+  // Ignore Histogram count updates as they are handled by the Intrinsic. This
+  // happens when the same pointer is first used to read from and then is used
+  // to write to.
+  if (!AIsWrite && BIsWrite && APtr == BPtr && HistogramPtrs.contains(APtr)) {
+    LLVM_DEBUG(dbgs() << "LAA: Histogram: Update is safely ignored. Pointer: "
----------------
huntergr-arm wrote:

I removed most of the debug printing (keeping the main 'found' message), but added a histogram dependency type so that we can test the analysis part independently of any transformation.

I also deferred some of the checks to the cost modelling part of transformation -- the element types supported depend on the target, and we now have the ability to scalarize if needed. The base cost function will need to be updated at some point to reflect that.

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


More information about the llvm-commits mailing list