[llvm] [TTI] Add alignment argument to TTI for compress/expand support (PR #83516)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 18:16:28 PST 2024


================
@@ -1609,3 +1609,28 @@ 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;
+
+  Type *ScalarTy = VTy->getScalarType();
+  if (ScalarTy->isFloatTy() || ScalarTy->isDoubleTy())
----------------
topperc wrote:

This is incorrect for Zve32f which doesn't support double or Zve64x and Zve32x that don't support float. There should be a function that handles this correctly in the gather/scatter TTI hook

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


More information about the llvm-commits mailing list