[llvm] [AArch64][SVE] Implement demanded bits for @llvm.aarch64.sve.cntp (PR #168714)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 19 08:25:59 PST 2025
================
@@ -19459,6 +19459,32 @@ static std::optional<unsigned> IsSVECntIntrinsic(SDValue S) {
return {};
}
+// Returns the element size associated with an SVE cnt[bhwdp] intrinsic. For
+// cntp (predicate), the element size corresponds to the legal (packed) SVE
+// vector type associated with the predicate. E.g. nxv4i1 returns 32.
+static std::optional<unsigned> GetSVECntElementSize(SDValue Op) {
+ if (auto ElementSize = IsSVECntIntrinsic(Op))
+ return ElementSize;
+ Intrinsic::ID IID = getIntrinsicID(Op.getNode());
+ if (IID != Intrinsic::aarch64_sve_cntp)
+ return {};
+ EVT PredVT = Op.getOperand(Op.getNumOperands() - 1).getValueType();
----------------
MacDue wrote:
1 or 2 works (0 is the IID)
https://github.com/llvm/llvm-project/pull/168714
More information about the llvm-commits
mailing list