[llvm] [RISCV] Support `llvm.masked.compressstore` intrinsic (PR #83457)

Kolya Panchenko via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 12:19:32 PDT 2024


================
@@ -1620,3 +1620,15 @@ bool RISCVTTIImpl::isLSRCostLess(const TargetTransformInfo::LSRCost &C1,
                   C2.NumIVMuls, C2.NumBaseAdds,
                   C2.ScaleCost, C2.ImmCost, C2.SetupCost);
 }
+
+bool RISCVTTIImpl::isLegalMaskedCompressStore(Type *DataTy, Align Alignment) {
+  auto *VTy = dyn_cast<VectorType>(DataTy);
+  if (!VTy || VTy->isScalableTy() || !ST->hasVInstructions())
+    return false;
+
+  if (!TLI->isLegalElementTypeForRVV(
+          TLI->getValueType(DL, VTy->getElementType())))
+    return false;
+
+  return getRegUsageForType(VTy) <= 8;
----------------
nikolaypanchenko wrote:

It's not for the store, but for the compress. Splitting it for LMUL >= 16 is doable, but is not simple

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


More information about the llvm-commits mailing list