[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 26 03:24:37 PDT 2024


================
@@ -144,7 +144,9 @@ class MemoryDepChecker {
       // on MinDepDistBytes.
       BackwardVectorizable,
       // Same, but may prevent store-to-load forwarding.
-      BackwardVectorizableButPreventsForwarding
+      BackwardVectorizableButPreventsForwarding,
+      // Access is to a loop loaded value, but is part of a histogram operation.
+      Histogram
----------------
huntergr-arm wrote:

Yes. Would you prefer a second method to indicate that it's safe to vectorize with histograms? Or an argument or flag to allow it?

I've noticed that decision making has been migrating to using the cost model instead of outright rejecting loops in legality or LAA, so structured it that way. We can scalarize the intrinsic for targets without appropriate instructions (implemented in ScalarizeMaskedMemIntrin.cpp), so it seems safe enough for LoopVectorize.

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


More information about the llvm-commits mailing list