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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 29 11:06:19 PST 2024


================
@@ -1609,3 +1609,10 @@ bool RISCVTTIImpl::isLSRCostLess(const TargetTransformInfo::LSRCost &C1,
                   C2.NumIVMuls, C2.NumBaseAdds,
                   C2.ScaleCost, C2.ImmCost, C2.SetupCost);
 }
+
+bool RISCVTTIImpl::isLegalMaskedCompressStore(Type *DataTy) {
----------------
topperc wrote:

We would need to scale the VL from the vcpop to use `vse8`.

Doesn't look like alignment was accounted for in the intrinsic definition. masked.gather/scatter had a separate argument. vp.gather/scatter use a pointer attribute. I think we should use the pointer attribute for compress store.

It looks like SelectionDAGBuilder::visitMaskedStore currently sets the alignment to the ABI alignment of the vector type which doesn't make sense.

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


More information about the llvm-commits mailing list