[llvm] [AArch64][SVE] Fold nested boolean UMIN trees (PR #209234)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 30 06:40:54 PDT 2026


================
@@ -573,6 +573,106 @@ define <vscale x 16 x i1> @dupq_b_idx(i64 %idx) #0 {
   ret <vscale x 16 x i1> %5
 }
 
+define <vscale x 16 x i8> @logical_bool_tree_i8(<vscale x 16 x i1> %pg, <vscale x 16 x i8> %a, <vscale x 16 x i8> %b, <vscale x 16 x i8> %c, <vscale x 16 x i8> %d) #0 {
+; CHECK-LABEL: define <vscale x 16 x i8> @logical_bool_tree_i8(
+; CHECK-SAME: <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[A:%.*]], <vscale x 16 x i8> [[B:%.*]], <vscale x 16 x i8> [[C:%.*]], <vscale x 16 x i8> [[D:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT:    [[TMP1:%.*]] = call <vscale x 16 x i8> @llvm.aarch64.sve.umin.u.nxv16i8(<vscale x 16 x i1> [[PG]], <vscale x 16 x i8> [[A]], <vscale x 16 x i8> [[B]])
----------------
paulwalker-arm wrote:

Now the transformation is specific to umin it's worth creating sve-intrinsic-opts-umin.ll.  If multiple smaller combines work for your use case then the tests can be simplified as well to match the new patterns.

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


More information about the llvm-commits mailing list