[llvm] [AArch64] Use firstp for SVE2.2 cttz.elts (PR #221182)

Vimal Patel via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 13 02:20:48 PDT 2026


================
@@ -9169,8 +9153,12 @@ SDValue AArch64TargetLowering::LowerOperation(SDValue Op,
     }
 
     SDValue Pg = getPredicateForVector(DAG, DL, VT);
-    SDValue NewCttzElts =
-        DAG.getNode(AArch64ISD::CTTZ_ELTS, DL, MVT::i64, Pg, CttzOp);
+    // We preserve the poison semantics here to avoid the poison path from being
+    // affected by the checks emitted for the no-poison case.
+    unsigned Opcode = Op.getOpcode() == ISD::CTTZ_ELTS_ZERO_POISON
+                          ? AArch64ISD::CTTZ_ELTS_ZERO_POISON
----------------
pvimal816a wrote:

Discussed offline. The conclusion is that the scalable predicate must be created when the length of the original fixed vector is known. Once the fixed-length data vector is converted to scalable vector it would be tedious to construct a scalable predicate.

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


More information about the llvm-commits mailing list