[llvm] [AArch64][SVE] Implement demanded bits for @llvm.aarch64.sve.cntp (PR #168714)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 19 07:12:05 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();
----------------
paulwalker-arm wrote:
Surely just Op.getOperand(0)?
https://github.com/llvm/llvm-project/pull/168714
More information about the llvm-commits
mailing list