[llvm] [AArch64] Consider histcnt smaller than i32 in the cost model (PR #108521)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 07:15:41 PDT 2024


================
@@ -517,25 +517,31 @@ static bool isUnpackedVectorVT(EVT VecVT) {
 static InstructionCost getHistogramCost(const IntrinsicCostAttributes &ICA) {
   Type *BucketPtrsTy = ICA.getArgTypes()[0]; // Type of vector of pointers
   Type *EltTy = ICA.getArgTypes()[1];        // Type of bucket elements
+  unsigned TotalHistCnts = 1;
 
-  // Only allow (32b and 64b) integers or pointers for now...
+  // Only allow (up to 64b) integers or pointers
----------------
huntergr-arm wrote:

I'd suggest adding a variable `unsigned EltSize = EltTy->getScalarSizeInBits();` and using it both in the initial size check and the total size check below.

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


More information about the llvm-commits mailing list