[llvm] [AArch64] Lower fixed find_last_active to LASTP with SVE2.2 (PR #222534)

Vimal Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 03:37:46 PDT 2026


================
@@ -2289,6 +2289,16 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
       for (auto VT : {MVT::v8i8, MVT::v16i8, MVT::v4i16, MVT::v8i16, MVT::v4f16,
                       MVT::v8f16, MVT::v4bf16, MVT::v8bf16})
         setOperationAction(ISD::VECTOR_COMPRESS, VT, Custom);
+
+      // Mark the scalable predicate and fixed-length vector container types
+      // for custom lowering.
+      // Extracts can still combine to lastb/clastb, otherwise the target node
+      // lowers to lastp.
+      for (auto VT : {MVT::nxv16i1, MVT::nxv8i1, MVT::nxv4i1, MVT::nxv2i1,
+                      MVT::v8i8, MVT::v16i8, MVT::v4i16, MVT::v8i16, MVT::v2i32,
----------------
pvimal816a wrote:

This is because we let the v*i1 types to legalize to v*i* types before lowering find_last_active to target specific node. Otherwise we need to lower mask vectors to SVE predicates in the lowering which I wanted to avoid this as it helps simplify `performFindLastActiveSelectCombine`.

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


More information about the llvm-commits mailing list